5

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?

Laurence
  • 58,936
  • 21
  • 171
  • 212
Swaraj Giri
  • 4,007
  • 2
  • 27
  • 44

1 Answers1

7

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
Gareth Daine
  • 4,016
  • 5
  • 40
  • 67
  • What do your cron error logs say? Also, how have you added this cronjob? – Gareth Daine Apr 08 '14 at 08:27
  • Added the script via crontab -e Log: Apr 8 15:08:01 swaraj-pc CRON[18655]: (swaraj) CMD (cd /var/www/huge/ && /usr/local/bin/php artisan queue:listen) Apr 8 15:08:01 swaraj-pc CRON[18654]: (CRON) info (No MTA installed, discarding output) – Swaraj Giri Apr 08 '14 at 09:40
  • Do you get any errors? Or anything in your cron error log? – Gareth Daine Apr 08 '14 at 10:46
  • My sincere apologies. Your cron script works, i was just too blind to notice the path error. Thanks a ton. `* * * * * cd /var/www/test/huge/ && /usr/local/bin/php artisan queue:listen` – Swaraj Giri Apr 08 '14 at 13:39