问题
I have got a page which queues up emails in beanstalked.
The script works as intended, the emails get fired when i have a queue listener, ie.
php artisan queue:listen
But when i remove the listener and add it to the crob job
* * * * * /usr/bin/php /var/www/huge/artisan queue:listen
The emails don't get fired. Any ideas?
回答1:
Had this exact same issue the other day, you probably just need to cd in to the directory where Artisan is located first. Try the following:
* * * * * cd /var/www/huge/ && /usr/bin/php artisan queue:listen
Also, are you sure the currently in use PHP CLI is located at /usr/bin and not /usr/local/bin?
If the above doesn't work try:
* * * * * cd /var/www/huge/ && /usr/local/bin/php artisan queue:listen
来源:https://stackoverflow.com/questions/22917116/laravel-artisan-cron-not-working