Software & SaaSEngineering note

The Cron Job Was Set and Nothing Ran for Four Days: Laravel's Scheduler on Shared Hosting

A scheduler that fails before any job starts leaves no trace in the app's own dashboard, and a cron line ending in >> /dev/null throws away the only error message. Check the framework log, and test with the same PHP restrictions as the server.

Author

CrpyByte Engineering

Published

Reading time

3 min read

On 16 November 2026 we deployed an automation module to a Laravel 12 site we look after: AI drafts each night, scheduled publishing every five minutes, a weekly broken-link check. It sits on shared cPanel hosting with PHP 8.4. The cron line that runs Laravel's scheduler was added the same day, every minute:

* * * * * /usr/local/bin/ea-php84 /home/<account>/<app>/artisan schedule:run >> /dev/null 2>&1

Four days later the site's own automation page still said "Last: never" for all six jobs. The run history was empty. The page even showed its own warning that the server cron was probably not set. It was set, and it had run thousands of times.

Where the error actually was

The cron line sends everything to /dev/null, so cPanel had nothing to show and no email was sent. The app's dashboard records a job only once it starts, and nothing ever started. The one place left was the framework's own log, storage/logs/laravel.log. It had grown to 37.6 MB, with the same entry every minute:

production.ERROR: The Process class relies on proc_open, which is not available on your PHP installation.

The stack trace pointed at Laravel's scheduler, not at any of our jobs. Schedule::command('…') does not run the command inside the current PHP process. It builds a new php artisan … command line and starts it as a child process through Symfony's Process component, which needs PHP's proc_open. Many shared hosts disable proc_open for security. So every minute the scheduler found a job due, tried to start it, failed, and logged the error.

The fix: run the job in the same process

Laravel can also schedule a closure, which runs in the scheduler's own process. Inside it, Artisan::call() runs the same console command without starting anything new:

// routes/console.php

// Before: needs proc_open
Schedule::command('automation:run-due')->everyFiveMinutes()->withoutOverlapping(15);

// After: runs in-process
Schedule::call(fn () => Artisan::call('automation:run-due'))
    ->name('automation-run-due')   // required for withoutOverlapping() on a closure
    ->everyFiveMinutes()
    ->withoutOverlapping(15);

We changed the two scheduled entries this way (the automation runner and a queue:work --stop-when-empty call). Ten minutes after the file went live, the run history showed its first two runs ever, both from cron, and the error stopped appearing in the log.

Test it the way the server runs it

Before uploading, we reproduced the server's restriction on a laptop. PHP lets you disable functions for one run:

php -d disable_functions=proc_open,proc_get_status,proc_close artisan schedule:run

With the old code this printed the same proc_open error as the live log. With the new code both entries finished and every automation job was given its next run time. Five minutes of testing that would have saved four days.

It had happened to us before

On 1 November 2026 a second Laravel app of ours on the same host stopped sending email for the same reason: its scheduled commands could not start. We fixed that app and did not carry the lesson over to the next deploy. It is now a line in our deploy checklist.

A checklist for Laravel on shared hosting

  1. Ask what the host disables. Run php -i | grep disable_functions with the same PHP binary the cron uses. Look for proc_open, exec, shell_exec, pcntl.
  2. If proc_open is off, schedule closures: Schedule::call() with Artisan::call(), never Schedule::command() or Schedule::exec(). Give each closure a ->name().
  3. Do not send cron output to /dev/null at first. Write it to a log file you can read in File Manager, at least for the first week.
  4. Read the framework log after the first cron runs (storage/logs/laravel.log), not only your app's dashboard. A scheduler that fails before a job starts never reaches the dashboard.
  5. Test locally with the same disable_functions. One command, shown above.
  6. Rotate the log. Use the daily log channel so one repeated error cannot grow a single file to tens of megabytes.

If your scheduled jobs or queues are not running and the logs make no sense, tell us what you see. We will find where the job stops.

Written by

CrpyByte EngineeringEngineering team

The team that designs and builds CrpyByte client systems and tools. We write about the parts of the work worth writing down.

Have a process worth improving?

Let's build the system behind it. Tell us what the process is and where it breaks — the first conversation is about constraints, not technology.