问题
I'm using Laravel 4 + Beanstalk + Supervisor on a CentOS 6 VPS.
It was already a pain to install both beanstalk and supervisor on the VPS, but I got through it (I have done this same installation on my local server, a Macbook Pro, and it's working fine there).
I want to take advantage of Laravel 4's Queues and Beanstalk to send email asynchronously. I have made a "program" for supervisor that basically runs the command
php artisan queue:listen --env=production
but the process associated to that won't start succesfully. The log I defined for this process outputs the following:
[InvalidArgumentException]
There are no commands defined in the "queue" namespace.
So apparently artisan is finding something that it doesn't like at all.
Please, please, PLEASE, would you help me? Only results I've found on Google are an unanswered git issue post, and an equally useless thread with no answers on Laravel's forums.
Edit: Testing I've noticed that Artisan's queue:listen works fine when run by me in the shell, but when Supervisord tries to run the command, the InvalidArgumentException happens.
回答1:
The solution in my case, if any one of you ever come across this issue, was the following:
I had supervisord version 2.1 installed (via pip). I needed at least version 3.0 (because the "directory" setting (used in the supervisord.conf file) was introduced in the version 3.0.
I had to
pip uninstall supervisor
Then I had to
pip install supervisor==3.0
After that, I just had to set the desired configuration values in /etc/supervisord.conf, and my artisan
was running queue:listen
without problems.
回答2:
I had similar problem and got my answer to the question I posted that worked for me:
Supervisord makes my Laravel queue:listen throw InvalidArgumentException
Instead of doing:
[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
in the supervisor.conf i replaced the command with:
command=/usr/local/bin/php artisan queue:listen --env="local"
来源:https://stackoverflow.com/questions/19062341/laravel-4-queue-invalidargumentexception-there-are-no-commands-defined-in-th