Cron Job Not Running on Schedule in cPanel: 3 Fixes

Server & Cloud Intermediate 👁 8 views 📅 Jun 19, 2026

Your cron job in cPanel isn't running? It's almost always wrong paths, missing permissions, or a bad email. Here's how to fix it fast.

1. Your Script Path or Command Path is Wrong

This is the single most common reason a cron job won't run. You wrote php my_script.php, but cron doesn't see your home directory the way you do. Cron runs with a limited environment — it doesn't load your .bashrc or .profile. So paths that work in SSH or cPanel's Terminal will fail in cron.

The fix: Use absolute paths for everything. Every command, every script, every file.

Open cPanel → Cron Jobs. Instead of this:

php my_script.php

Write this:

/usr/local/bin/php /home/username/public_html/my_script.php

But wait — you need to know where PHP actually lives. Run this in SSH or cPanel Terminal:

which php

You'll probably see /usr/local/bin/php on most shared hosts, or /usr/bin/php on CentOS/RHEL VPS boxes. Use whatever that command returns.

Same for Python, Perl, or any other interpreter. Run which python3 or which perl to get the full path.

What you should see after the fix: The next scheduled run executes without error. Check the cron log at /var/log/cron (if you have root) or in cPanel's cron job interface. You'll see the job listed with the correct command, no 'command not found' errors.

2. The Script Itself Doesn't Have Execute Permissions

Even if the path is perfect, cron won't run a script that isn't executable. This trips up a lot of people because when you run php script.php, PHP reads the file directly. But if you call the script directly — like /home/user/public_html/script.php — it needs the execute bit set.

Here's the scenario: You wrote a Python script, set the cron command to /usr/bin/python3 /home/user/scripts/backup.py. It still doesn't run. Check permissions.

The fix: SSH in or open cPanel Terminal. Run:

chmod +x /home/user/scripts/backup.py

Also verify the shebang line at the top of the script is correct — first line should be #!/usr/bin/python3 or #!/usr/local/bin/php if it's a standalone PHP script. Without a shebang, the system won't know what interpreter to use when you call the script directly.

What you should see after the fix: The script runs at the next cron interval. If you set it to run every minute for testing, wait 60 seconds — then check if your script produced output or made changes. No more 'Permission denied' in syslog.

To double-check permissions, run ls -la /path/to/script. You should see -rwxr-xr-x or similar. The x in that string means it's executable.

3. Cron's Email Output Is Disabled or Bouncing

This is a sneaky one. By default, cron tries to email you the output (STDOUT and STDERR) of every job it runs. If your hosting account's email is broken, the mailbox is full, or you entered an invalid email in cPanel, cron can get stuck waiting for the mail transfer to complete. It doesn't fail gracefully — it just silently stops running future jobs.

Symptoms: The job runs once or twice, then stops. You see 'Mail send failed' in the cron logs. Or you never get any output at all and assume it didn't run.

The fix: Suppress the email output entirely. Edit your cron command. Add this to the end:

/usr/local/bin/php /home/user/public_html/script.php >/dev/null 2>&1

Let's break that down: >/dev/null sends normal output to the void. 2>&1 sends error output to the same void. Now cron has nothing to email, so it runs fast and clean.

If you want to keep errors for debugging, redirect to a log file instead:

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

This appends output to a file. Check that file after the next run. If you see nothing, the script ran clean. If you see errors, you know exactly what to fix.

What you should see after the fix: The job runs consistently every scheduled time. No more missed runs. No more 'Mail send failed' warnings in /var/log/cron or in cPanel's cron interface.

Quick-Reference Summary Table

Cause What to Check Fix Command Verify With
Wrong path Command uses relative path or missing interpreter path which php then use full path Check /var/log/cron for 'command not found'
No execute permission Script file lacks x bit chmod +x /full/path/script ls -la /path/script shows -rwxr-xr-x
Email output blocking Mailbox full or invalid email in cPanel Add >/dev/null 2>&1 to cron command Job runs consistently, no mail errors in cron log

Start with cause #1 — it's the fix that saves 9 out of 10 cron jobs. If that doesn't work, move to permissions, then email. By the time you've checked all three, your cron job should be running like clockwork.

Was this solution helpful?