I am using jobs in Laravel but do not know how to them in production on shared server
I ‘m not sure my shared server is able to handle the ubuntu supervisor script to handle queues
Is there any other way I can make job / queues work in production.
I’ surprised at the very few & vague answers to this on the net.
I am running Laravel 10
[I understand I could be using cron Jobs and a scheduled command to run the worker:
(https://stackoverflow.com/q/46141652/2955335)
Can any one lead me on the right path
2
Answers
Most shared hosting providers don’t allow running Supervisor scripts, so if you’re on shared hosting, cron jobs are the best alternative to handle Laravel jobs, queues, and scheduling. Here’s how you can set it up:
Using Cron Jobs for Queues
Using Laravel Scheduler,
php /project-path/artisan schedule:run >> /dev/null 2>&1
Budget Consideration
If you or your client has the budget, consider moving to a VPS (Virtual Private Server). A VPS gives you full control over the server, allowing you to use Supervisor for managing queues more efficiently. It’s a better option for handling Laravel queues and jobs in production.
HI I’m Salman Senior Software Engineer & DevOps
On shared hosting, where you may not have access to install or manage
supervisor
, you can still handle Laravel queues effectively by using cron jobs to run the queue worker. Here’s how you can set it up:By combining these steps, you can efficiently run Laravel queues on a shared hosting environment without needing
supervisor
.