A Laravel script needs a cron job to run its scheduled tasks: sending queued emails, cleaning up old records, checking subscriptions and anything else the developer put on a timer. Without the cron entry, none of that happens — the scheduler simply never wakes up. The fix is one line in cPanel, and it takes about five minutes.
This guide covers shared hosting with cPanel, which is where most of our buyers install. The steps are the same on any host that gives you a cron jobs page; only the buttons look different.
What does a cron job actually do in Laravel?
Laravel has one scheduler, and it is deliberately simple. You add a single cron entry that runs php artisan schedule:run every minute. That command wakes up, checks which tasks are due, runs them, and exits. The tasks themselves — what runs hourly, daily or weekly — are defined in the code, usually in routes/console.php or the App\Console\Kernel. You do not add a cron entry per task; one entry drives them all.
That distinction matters, because the most common mistake we see is a buyer adding a separate cron job for every feature they want scheduled. One entry is enough. If the script's guide says 'set up a cron job', it means this one line.
How do you add the cron job in cPanel?
Open cPanel and find Cron Jobs under the Advanced section. The form looks old-fashioned, but it only needs three things: a schedule, a command, and an email address for output.
- Set the schedule to run every minute: * * * * * in all five fields.
- In the command box, enter: cd /home/youruser/public_html && php artisan schedule:run >> /dev/null 2>&1 — replace youruser and public_html with your real path.
- Put your email in the notification field so cPanel tells you when the job produces output.
- Save, then check the job appears in the list of current cron jobs.
Two details in that command do real work. cd moves into the project folder, because artisan only runs from the project root. And >> /dev/null 2>&1 throws away the output, so your inbox does not fill with an email every minute. Without that redirect, cPanel emails you the command's output each time it runs — 1,440 emails a day.
One more thing: the php in the command must be the PHP version your script needs. Some hosts put an older PHP first in the path even when your site uses PHP 8.2. If the job runs but nothing happens, try the full path your host documents, for example /usr/bin/php8.2. Our PHP 8.2 and 8.3 hosting checklist explains how to confirm which version your script is actually using.
Which cron schedule should you use?
Every minute, and here is why: Laravel's scheduler only checks for due tasks when schedule:run executes. Run it hourly and a task due at 09:15 waits until 10:00. Run it every minute and tasks fire within a minute of their due time. The command itself is cheap — it wakes, checks, and exits — so there is no saving in running it less often.
| Schedule | When it runs | What breaks |
|---|---|---|
| Every minute | * * * * * | Nothing — tasks fire on time, as intended |
| Every 5 minutes | */5 * * * * | Tasks run up to 5 minutes late; fine for non-urgent jobs |
| Hourly | 0 * * * * | Daily tasks may run hours late; queued emails pile up |
| Once a day | 0 0 * * * | The scheduler is effectively off; nothing runs on time |
If your host limits cron jobs to a minimum of every 15 minutes, the scheduler still works — it just runs late. That is a host limit, not a script bug, and it is worth knowing before you report a problem.
Why is your scheduled task not running?
When a buyer tells us their scheduled emails never arrive, the cause is almost always one of these five.
- The cron entry points at the wrong folder, so artisan is not found.
- The php binary is the wrong version, so the command fails silently.
- Output is discarded with >> /dev/null, so failures leave no trace.
- The task is defined in the code but disabled by a setting in the admin panel.
- The server clock or timezone is wrong, so 'due' is calculated against the wrong time.
The fastest diagnosis is to run the command by hand in a terminal, or temporarily remove >> /dev/null 2>&1 from the cron entry so cPanel emails you the output. The error message will usually name the problem directly — a missing file, a wrong PHP version, or a database error.
How do you check the scheduler is working?
Add a small check of your own: look for the thing the task is supposed to do. If it sends a daily summary email, you should receive one. If it cleans old records, the table should shrink. Logs help too: Laravel writes scheduler output to storage/logs/laravel.log, and many scripts keep a log of scheduled runs in the admin panel.
Our guide to installing a Laravel script on cPanel covers the first install end to end, including the cron step, and it is worth keeping open while you work through this one.
What about queues and long-running tasks?
A cron job and a queue worker are different jobs. Cron wakes the scheduler once a minute; a queue worker stays running and processes jobs as they arrive. Some scripts need both, and the guide will say so. If yours does, the worker is usually started with php artisan queue:work and kept alive with Supervisor on a VPS, or with a second cron entry on shared hosting that restarts it every few minutes.
Do not run queue:work as a cron job every minute without the --once flag or a stop condition — you will end up with dozens of workers competing for the same jobs. If the guide does not mention queues at all, your script probably does not need one, and the single scheduler entry is enough.
Get the one line right and the script takes care of itself after that. Every product in our catalogue ships with an installation guide and lifetime free updates, so the cron step for your script is documented. If you are still stuck, the answers on our FAQs page cover the common install errors, and support is a real human on WhatsApp at +92 333 4916432 or by email at contact@zqdevelopers.com.