Home › Cron Jobs in cPanel
How to Add a Cron Job in cPanel
cPanel's Cron Jobs interface wraps standard Linux cron in a GUI. This guide covers setup, PHP paths, email notifications and the things cPanel does differently from a raw crontab.
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.
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.
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.
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
| Task | Command |
|---|---|
| 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 |
Things That Go Wrong in cPanel Cron Jobs
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.
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.