我在CentOS 6 VPS上使用Laravel 4 + Beanstalk + Supervisor。
在VPS上安装beanstalk和supervisor已经很痛苦了,但我完成了它(我在本地服务器上做了同样的安装,Macbook Pro,它在那里工作正常)。
我想利用Laravel 4的Queues和Beanstalk以异步方式发送电子邮件。我为主管做了一个“程序”,基本上运行命令
php artisan queue:listen --env=production
但与之相关的流程不会成功启动。我为此过程定义的日志输出以下内容:
[InvalidArgumentException]
There are no commands defined in the "queue" namespace.
显然,工匠正在寻找一些根本不喜欢的东西。
拜托,请,你能帮助我吗?我在Google上找到的结果只是一个未得到答案的 git问题帖子,而且在Laravel论坛上没有答案的同样无用的帖子。
编辑:测试我注意到Artisan的队列:在shell中运行时,listen工作正常,但当Supervisord尝试运行命令时,会发生InvalidArgumentException。
答案 0 :(得分:2)
在我的案例中,如果您遇到过这个问题,我的解决方案如下:
我安装了supervisord 2.1版(通过pip)。我至少需要3.0版本(因为版本3.0中引入了“目录”设置(在supervisord.conf文件中使用)。
我不得不
pip uninstall supervisor
然后我不得不
pip install supervisor==3.0
之后,我只需在/etc/supervisord.conf中设置所需的配置值,我的artisan
运行queue:listen
没有问题。
答案 1 :(得分:0)
我遇到了类似的问题并得到了我发布的问题的答案:
Supervisord makes my Laravel queue:listen throw InvalidArgumentException
而不是:
[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
在supervisor.conf中的我用以下命令替换了命令:
command=/usr/local/bin/php artisan queue:listen --env="local"