Starting Horizon from a console with php artisan horizon works fine, but starting it from supervisor does not.
I get the following error log: https://gist.github.com/drewwalton19216801/6c46f8de7251a1f7af575fbba20d392c (log modified to hide the name of my project)
I do have the pcntl extension installed.
I should also mention that Horizon works fine when started via supervisor on my deployment server which runs Ubuntu 18.04, so this seems to be macOS related.
Error message from your log:
Call to undefined function Laravel\Horizon\Console\pcntl_async_signals()
If an undefined _function_ call is prefixed with a namespace, it's an indicator it does not exist on the top level.
Which PHP version are you using?
pcntl_async_signals is a fairly recent addition to PHP and requires 7.1 .
The version of PHP I'm currently using is 7.2.7.
Still not working as of PHP 7.2.8 on macOS 10.13.6. Should be noted that it works fine when started manually with php /path/to/artisan horizon, so the fact that supervisor cannot start it is beyond me and highly frustrating.
Is it possible that you've different PHP versions installed (homebrew?) and via terminal you get your 7.2.7 but supervisor picks up e.g. the default OSX version or something?
What your full supervisor configuration? Did you explicitly specify that path to your PHP binary (probably /usr/local/bin/php?)
Good catch, @mfn. Providing the full path fixed it. This should probably be noted in the official docs.
Is it possible that you've different PHP versions installed (homebrew?) and via terminal you get your 7.2.7 but supervisor picks up e.g. the default OSX version or something?
What your full supervisor configuration? Did you explicitly specify that path to your PHP binary (probably
/usr/local/bin/php?)
Thanks for the answer, it also help me to solve the same problem.
Most helpful comment
Is it possible that you've different PHP versions installed (homebrew?) and via terminal you get your 7.2.7 but supervisor picks up e.g. the default OSX version or something?
What your full supervisor configuration? Did you explicitly specify that path to your PHP binary (probably
/usr/local/bin/php?)