Laravel工匠Cron不起作用 [英] Laravel artisan cron not working
问题描述
我有一个页面,该页面将被缠扰的电子邮件排队.
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
但是当我删除侦听器并将其添加到 crob 作业时
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?
推荐答案
前几天有同样的问题,您可能只需要先CD进入Artisan所在的目录即可.请尝试以下操作:
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
还可以确定当前使用的PHP CLI位于/usr/bin而不是/usr/local/bin吗?
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
这篇关于Laravel工匠Cron不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!