cPanel

cPanel cron job not running? Troubleshooting and correct command formats

Fix cron jobs in cPanel that do not run or fail silently: correct PHP paths, absolute file paths, output emails, URL-based crons, timing syntax and logging.

IntermediatecPanel hosting2 min read

A cron job that never seems to run is usually running, but failing: the command uses the wrong PHP version, a relative path, or an output redirect hides the error. This guide shows how to make cron jobs visible, and the command formats that work on cPanel hosting. For creating jobs, see cPanel cron jobs.

Before you start

  • Open cPanel → Advanced → Cron Jobs and look at the existing job's command and schedule.
  • Terminal access helps a lot: if the command fails in Terminal, it will fail in cron too.

Step 1: see the output

Cron sends a command's output by email to the address in Cron Email at the top of the Cron Jobs page. If your command ends with >/dev/null 2>&1, all output and errors are thrown away. For troubleshooting, write them to a log instead:

/usr/local/bin/php /home/cpuser/public_html/script.php >> /home/cpuser/cron.log 2>&1

Wait for the next run, then open cron.log in File Manager. Remove logging once it works, or the file keeps growing.

Step 2: use the right PHP binary

BinaryUse
/usr/local/bin/phpServer default PHP CLI
/opt/cpanel/ea-php83/root/usr/bin/phpA specific EasyApache PHP version (here 8.3)
/opt/alt/php83/usr/bin/phpA specific CloudLinux alt-php version

Use the same version as the website (shown in MultiPHP Manager). Many "works in browser, fails in cron" problems come from the CLI using an older PHP.

Step 3: use absolute paths

  • Cron starts in your home directory, not in the script's folder. Use full paths like /home/cpuser/public_html/....
  • If the script includes files with relative paths, change into its folder first:
    cd /home/cpuser/public_html/app && /usr/local/bin/php artisan schedule:run

Step 4: check the schedule syntax

ScheduleMinute Hour Day Month Weekday
Every 15 minutes*/15 * * * *
Every day at 03:3030 3 * * *
Mondays at 08:000 8 * * 1
First day of the month at midnight0 0 1 * *

Times use the server's time zone, which may differ from yours. Check with date in Terminal.

Tip: Avoid running heavy jobs every minute. Frequent jobs count toward your CloudLinux limits; see resource usage.

URL-based cron jobs

Some apps give you a URL to call. Use curl or wget:

curl -fsS "https://example.com/cron.php?key=SECRET" >/dev/null

Quote URLs containing & or ?. If the site is behind a password (Directory Privacy) or a firewall challenge, the request fails; call the PHP file directly with the CLI instead.

Common errors in the log

  • Could not open input file: wrong path to the script.
  • Permission denied: you tried to execute a file directly without php in front, or it lacks execute permission.
  • /bin/sh: ... command not found: a tool is not in cron's minimal PATH; use its full path.
  • Allowed memory size exhausted: add -d memory_limit=512M after the PHP binary.

Next steps

Was this guide helpful?

Still stuck?

Ask MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.