Home › cPanel Cron Jobs

cPanel Cron Jobs: Setup, PHP Path and Troubleshooting

How to add, edit and debug cron jobs in cPanel. Covers the Cron Jobs GUI, finding the correct PHP path, email notifications, WordPress WP-Cron setup and the most common causes of a cPanel cron job not running.

Where to Find Cron Jobs in cPanel

Log in to cPanel and go to Advanced › Cron Jobs. If you cannot find it, use the search bar and type "cron". The official cPanel documentation is at docs.cpanel.net › Cron Jobs.

cPanel Cron Jobs page showing the Add New Cron Job form with Minute, Hour, Day, Month, Weekday fields and Command field
cPanel Cron Jobs - Advanced › Cron Jobs. The email field is at the top; the job form and current jobs list are below.

The Cron Jobs page has two sections: the email notification setting at the top, and the job scheduler below. You do not need to restart anything after adding a job - cPanel writes directly to the system crontab and the cron daemon picks it up immediately.

Step by Step: Add a New Cron Job

1. Set the schedule

Under "Add New Cron Job", use the dropdown presets (Every Minute, Every Hour, Every Day...) or enter the values manually in the five fields: Minute, Hour, Day, Month and Weekday. The dropdowns fill in the fields for you - but you can still edit them manually for custom expressions.

Use the generator below to build the expression first, then paste it into the fields.

2. Enter the command

In the Command field, enter the full command to run. For a PHP script:

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

Replace username with your cPanel account username.

3. Click "Add New Cron Job"

The job appears immediately in the "Current Cron Jobs" table at the bottom of the page. You can edit or delete it from there at any time.

cPanel Current Cron Jobs table showing added cron jobs with Edit and Delete buttons

4. Manage email notifications

At the top of the Cron Jobs page, enter an email address to receive the output of every cron job run. Useful for debugging but noisy in production. To suppress emails for a specific job, append > /dev/null 2>&1 to the command.

cPanel Cron Jobs email notification field at the top of the page

PHP Path in cPanel

The PHP path in cPanel is almost always /usr/local/bin/php, not /usr/bin/php. If your host runs multiple PHP versions, the path may include the version number. To find the correct path, open the cPanel Terminal (under Advanced) and run:

which php
# common results:
# /usr/local/bin/php
# /opt/cpanel/ea-php82/root/usr/bin/php

On EasyApache 4 (the current cPanel PHP manager), PHP binaries live under /opt/cpanel/ea-phpXX/root/usr/bin/php. If you need a specific version, use that full path.

Common cPanel Cron Commands

TaskCommand
Run a PHP script /usr/local/bin/php /home/user/public_html/script.php
Run a PHP script silently /usr/local/bin/php /home/user/script.php > /dev/null 2>&1
Fetch a URL (wget) /usr/bin/wget -q -O /dev/null https://example.com/cron.php
Fetch a URL (curl) /usr/bin/curl -s https://example.com/cron.php > /dev/null
WordPress WP-Cron replacement /usr/local/bin/php /home/user/public_html/wp-cron.php > /dev/null 2>&1
Run a Python script /usr/bin/python3 /home/user/scripts/task.py
Run Laravel scheduler /usr/local/bin/php /home/user/myapp/artisan schedule:run

cPanel Cron Job Not Running - Checklist

Wrong PHP path

The most common failure. cPanel's PHP path is /usr/local/bin/php, not the system /usr/bin/php. Use the Terminal to run which php and verify before adding the cron job.

Email flood

If you set a notification email and run jobs frequently (every minute), you will receive hundreds of emails per day. Suppress output for jobs that run correctly: add > /dev/null 2>&1 to the end of the command. Only keep email output for jobs where you need to be alerted on failure.

Script path includes the domain

In cPanel, your files are under /home/username/public_html/, not /var/www/html/. Make sure the path in the cron command matches the actual location on disk, not the web path.

Do not edit crontab via SSH

cPanel manages the crontab file directly. If you edit it via SSH with crontab -e, cPanel may overwrite your changes. Always use the cPanel GUI for cron jobs on shared hosting accounts.

cPanel minimum interval: once per minute

cPanel enforces a minimum interval of once per minute. You cannot schedule a job more frequently than * * * * *. For sub-minute jobs, use a script that loops internally.

Enable cron job email to debug

If the job runs but does nothing, temporarily set the email notification address and remove > /dev/null 2>&1 from the command. The next run will email you the full output including any error messages.

Build your cron expression

Use the generator to get the five fields right, then paste them directly into cPanel's Minute, Hour, Day, Month and Weekday fields.