Symfony Process Exit Code: 127(Command not found) on macOS

If you get the error Process Exit Code: 127(Command not found) in Symfony Process, it’s usually a problem with your system’s local path.

The tricky part of understanding is that your system can be using a different $PATH for Nginx then what you are using as a user.

If you run this command in your terminal:

php -r 'print getenv("PATH");'

The path seems fine. However, if you try this in you PHP-script you can get different results:


var_dump(getenv('PATH'));

Instead of fiddling with your system’s setup, you can temporarily add the path in your PHP-script before executing, like this:


 putenv('PATH=/usr/local/bin');