Menu

Laravel Queues and Cron on Shared Hosting: What Actually Works
📰

Laravel Queues and Cron on Shared Hosting: What Actually Works

DEV Community: laravel·Rishav Mandal·about 7 hours ago
#7oQpoRS3
#devtolaravel#devto#dev#jobs#cron
Long article (1170 words) — no AI summary yet.
Reading 0:00
15s threshold

Key takeaways

Laravel queues on shared hosting work without Supervisor: cron starts a short-lived worker every minute with --stop-when-empty and --max-time=55 .

Some hosts don't run cron commands written as cd … && … ; use the host's PHP cron type with an absolute path to artisan.

Re-enable proc_open if needed, make repeatable jobs unique, keep every job under a minute, and monitor the queue for silent failures.

Laravel's documentation assumes you can run a long-lived queue worker under a process manager like Supervisor. On a VPS that's easy. On shared hosting — still the cheapest way to put a Laravel app online — you usually can't.

That doesn't mean giving up on queues. Emails, image processing, sitemap generation and scheduled publishing all belong in the background, especially when a slow mail server can otherwise make a signup page hang for several seconds.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.