Laravel queue environment

Ran in to an issue running queue through supervisor. I’ll give a quick rundown of my setup, the issue and solution.

I have supervisor running the queue daemon.

[program:laravel_queue]
command=php /var/www/example.com/artisan queue:listen
autostart=true
autorestart=true
stderr_logfile=/var/log/laraqueue.err.log
stdout_logfile=/var/log/laraqueue.out.log

The key part check on is the env variable isn’t set automatically for the queue. You’ll need to set it via the —env flag.

[program:laravel_queue]
command=php /var/www/example.com/artisan queue:listen --env=prod
autostart=true
autorestart=true
stderr_logfile=/var/log/laraqueue.err.log
stdout_logfile=/var/log/laraqueue.out.log

That’s what I was missing. Once I `sudo supervisorctl restart laravel_queue` all was well with the queue.

0 comments