Skip to content

Instantly share code, notes, and snippets.

@shengslogar
Last active December 15, 2021 17:25
Show Gist options
  • Save shengslogar/a7f88c84b58ad088cfe8d0fadbb17a8c to your computer and use it in GitHub Desktop.
Save shengslogar/a7f88c84b58ad088cfe8d0fadbb17a8c to your computer and use it in GitHub Desktop.

Issue with PHP-FPM inheriting system-level variables (specifically, PATH)

Running Notes

Environment: PHP 7.4, Homebrew, Laravel Valet, Apple Silicon

Problem

PHP-FPM can't resolve getenv('PATH') while PHP-CLI can.

This causes binaries to not be found when attempting to invoke directly from within a Laravel controller.

Sloppy Workaround

Copying system level PATH= variable into project .env file is a workaround.

Related

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment