Hello, I have this problem only when I run it with supervisor. It's interesting that locally with homestead works, but on productions I got this.
[Symfony\Component\Console\Exception\CommandNotFoundException]
Command "horizon" is not defined.
Content-type: text/html; charset=UTF-8
php artisan --version
Laravel Framework 5.5.1
[program:laravel-horizon]
directory=/home/myuser/mydomain.com
process_name=%(program_name)s_%(process_num)02d
command=php /home/myuser/mydomain.com/artisan horizon
autostart=true
autorestart=true
user=myuser
numprocs=1
redirect_stderr=true
stdout_logfile=/home/myuser/mydomain.com/storage/logs/horizon.log
When I run from console
php /home/myuser/mydomain.com/artisan horizon
it works like a charm.
Any ideas?
When I changed command to full PHP path
command=/opt/cpanel/ea-php71/root/usr/bin/php /home/myuser/mydomain.com/artisan horizon
started to work
Close the issue if you think it's not related to horizon at all.
I just notice, that now it shows
`````
[2017-09-05 05:23:20] staging.ERROR: There are no commands defined in the "horizon" namespace. {"exception":"[object] (Symfony\Component\Console\Exception\CommandNotFoundException(code: 0): There are no commands defined in the \"horizon\" namespace. at /home/studio77d/mysite.com/vendor/symfony/console/Application.php:548)
[stacktrace]
`````
[program:horizon]
process_name=%(program_name)s
command=/opt/cpanel/ea-php71/root/usr/bin/php artisan horizon
directory=/home/app/laravel
stdout_logfile=/home/app/laravel/storage/logs/horizon.log
redirect_stderr=true
autostart=true
autorestart=true
This does not work. I get:
[Symfony\Component\Console\Exception\CommandNotFoundException]
Command "horizon" is not defined.
Content-type: text/html; charset=UTF-8
I am using cpanel 60, php 7.1 , centos6.9 , laravel 5.5 on my remote VPS that is suffering from this problem . Everything worked like a charm on my local ubuntu 16.04 server... Is there a possible fix?
@neorganic - same here
Just wanted to give an update on my situation - that may help @RRStoyanov and other that faced similar problems. So I've managed to start supervisor with(for now) all sides working properly with one new property added.
[program:horizon]
process_name=%(program_name)s
command=/opt/cpanel/ea-php71/root/usr/bin/php /home/app/laravel/artisan horizon
directory=/home/app/laravel
environment=PATH="/usr/local/bin"
stdout_logfile=/home/app/laravel/storage/logs/horizon.log
redirect_stderr=true
autostart=true
autorestart=true
environment=PATH="/usr/local/bin" <--- so this line solved my problems. Don't ask me why.
@neorganic seems to fix my instance as well! Thanks!
@neorganic this has also fixed my issue, thank you.
@neorganic same here, thanks!
@neorganic any ideia why that line solved the problem?
Most helpful comment
Just wanted to give an update on my situation - that may help @RRStoyanov and other that faced similar problems. So I've managed to start supervisor with(for now) all sides working properly with one new property added.
environment=PATH="/usr/local/bin" <--- so this line solved my problems. Don't ask me why.