Laravel artisan cron not working

≯℡__Kan透↙ 提交于 2021-01-22 11:53:51

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!