Supervisord makes my Laravel queue:listen throw In

2020-07-24 06:20发布

问题:

I'm having exactly the same issue as in the post here:

Laravel 4 Queue - [InvalidArgumentException] There are no commands defined in the "queue" namespace.

Centos 6.5 Final. Laravel 4.2, Supervisor 3.0 and Python 2.6.6

The config for the app:

[program:lvcartsey]
command=php artisan queue:listen --env="local"
stdout_logfile=/home/mike/web/app/storage/logs/myqueue_supervisord.log
redirect_stderr=true
directory=/home/mike/web
;autorestart=true
;autostart=true
user=mike

Once I start supervisor I get this in my myqueue_supervisord.log:

  [InvalidArgumentException]
  There are no commands defined in the "queue" namespace.

When run from the command line php artisan queue:listen works as expected.

I searched google, but I found no useful information regarding this issue. Anyone knows what might be the cause of this? How does running artisan from command line differ from supervisor running it?

回答1:

See this answer. It's probably a fix for you too.

What you want to do is to change

command=php artisan queue:listen --env="local"

to

command=/usr/local/bin/php artisan queue:listen --env="local"