cPanel Cron Jobs Guide
cPanel exposes standard Linux cron through a web UI (Advanced > Cron Jobs) for shared and managed hosting accounts that don't have shell access — the same cron daemon and 5-field syntax underneath, but the most common problems are specific to how cPanel wraps it: PHP path ambiguity, email spam, and relative-path failures.
Syntax Notes
cPanel's Cron Jobs page offers dropdown presets (Once Per Minute, Once Per Hour, etc.) or a 'Common Settings' selector, but underneath it's still standard 5-field minute/hour/day/month/weekday cron — the five input fields map directly to those fields and accept the same wildcards, ranges, and steps.
Examples
/usr/local/bin/php -q /home/username/public_html/cron.phpwget -q -O - https://example.com/cron.php >/dev/null 2>&1*/15 * * * * /home/username/scripts/task.shGotchas
- cPanel emails the account's owner every single run by default unless the command's output is redirected or suppressed — a 5-minute job with no redirection can flood an inbox with hundreds of emails a day.
- The PHP binary path varies by hosting provider and by the PHP version selected in MultiPHP Manager — a bare `php script.php` command often fails silently because the shell's default PHP CLI doesn't match the site's configured web-facing PHP version. Use the full version-specific path (e.g. /usr/local/bin/php81) or whatever `which php` returns in cPanel's Terminal.
- Relative paths fail under cron because cPanel cron jobs execute from the account's home directory, not the script's own directory — always cd into the directory first or use absolute paths for the script and anything it references.
Best Practices
- Always append `>/dev/null 2>&1` (or redirect to a log file) to the end of every cron command to stop cPanel's default per-run email notifications.
- Confirm the exact PHP CLI path and version with `which php` or MultiPHP Manager rather than assuming the PATH's `php` matches your site's configured PHP version.
- Use the Cron Jobs UI's built-in next-run preview to sanity-check an expression before saving, especially for less common day-of-week or day-of-month combinations.
Frequently Asked Questions
- Why am I getting an email every time my cPanel cron job runs?
- cPanel emails the account holder any output — including warnings and notices — from every cron execution by default. Redirect both stdout and stderr (append >/dev/null 2>&1 to the command) to stop the emails, or redirect to a log file if you want to keep the output.
- Why does my PHP script work when I run it manually but fail under cPanel cron?
- cPanel cron jobs often invoke a different PHP binary or version than your site's web-facing PHP, and the command runs with the account's home directory as its working directory rather than the script's folder. Use the full path to the correct php binary (from MultiPHP Manager or `which php`) and absolute paths throughout.
- Does cPanel support the same cron syntax as regular Linux cron?
- Yes — cPanel's Cron Jobs UI is a front-end for the same underlying cron daemon and standard 5-field syntax. Anything valid in a normal crontab works identically when entered through cPanel.
Related Tools
Platform Guides
Cron syntax for Linux, Kubernetes, AWS, and more
systemd Timers vs Cron
How systemd timers work as a modern alternative to cron: OnCalendar syntax, unit file setup, and when timers are actually worth switching to.
GitLab CI Scheduled Pipelines
How to schedule GitLab CI/CD pipelines with cron syntax: the Schedules UI, timezone handling, rules:if conditions, and common gotchas.