Supervisord 让我的 Laravel 队列:listen throw InvalidArgumentException

2022-01-13 00:00:00 centos php laravel supervisord

我遇到的问题与这里的帖子完全相同:

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

Laravel 4 队列 - [InvalidArgumentException]队列"中没有定义命令.命名空间.

Centos 6.5 最终版.Laravel 4.2、Supervisor 3.0 和 Python 2.6.6

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

应用的配置:

[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

一旦我启动主管,我就会在 myqueue_supervisord.log 中得到这个:

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

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

当从命令行运行时,php artisan queue:listen 会按预期工作.

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

我搜索了谷歌,但没有找到有关此问题的有用信息.任何人都知道这可能是什么原因?从命令行运行 artisan 与运行它的主管有何不同?

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?

推荐答案

参见这个答案.它可能也适合你.

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

你想做的就是改变

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

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

相关文章