How to create and check cron jobs in cPanel
A cron job runs a command for your site at the time you choose: WordPress reminders, Moodle’s cron, a script that backs up your store. If your report says a cron job is failing, it’s almost always because the file it runs no longer exists or moved. Here’s how to create a cron job and how to find out why one fails.
Create a cron job
Log in to cPanel and, in the Advanced section, open Cron Jobs.

In Add New Cron Job, open Common Settings and choose the frequency. For almost everything, Once Per Hour or Once Per Day is enough. Moodle is the exception: it needs Once Per Minute.

In Command, enter the full path to PHP and to the file, for example:
/usr/local/bin/php /home/youruser/public_html/script.phpYour cPanel username and folder path appear in the General Information panel on the cPanel home page.
Click Add New Cron Job. The job appears below, in Current Cron Jobs.
If a cron job is failing
1. Let the job tell you what happens
At the top of the page, in Cron Email, enter an address you read and save. Every time a job prints something or fails, you get an email with the exact message. Once you fix it, clear that field, or you’ll get a message every time it runs.
2. Look up the error in the list of causes
| What the email says | What happened | What to do |
|---|---|---|
Could not open input file or No such file or directory | The file is no longer at that path: you deleted it, moved it or removed the site. | If you don’t use it anymore, delete the job. If you do, fix the path with Edit. |
Permission denied | The file can’t be executed. | Put php before the path instead of running the file directly. |
PHP Fatal error or Parse error | The script ran, but fails on that PHP version. | Check that the command uses the same PHP version as your site (see below). |
command not found | The command doesn’t exist on the server. | Use full paths, such as /usr/local/bin/php. |
3. Check the command’s PHP version
/usr/local/bin/php uses the version you chose in Select PHP Version; it’s the same example cPanel shows on that page. If the command has a path with a fixed version, for example /opt/alt/php74/usr/bin/php, that job keeps using PHP 7.4 even if your site already uses 8.3. The same goes for /usr/local/cpanel/3rdparty/bin/php, which is cPanel’s internal PHP, not your site’s. Replace either one with /usr/local/bin/php.
4. Delete orphaned jobs
If you removed a site, a WordPress or a Moodle, its cron job stays behind and fails every time it runs. In Current Cron Jobs, click Delete on the jobs that point to folders that no longer exist.
If you still don’t know what fails
Open a ticket and paste the job’s command and the error email. We’ll tell you what to fix. If it’s Moodle’s cron, also see how to tell whether Moodle’s cron is running.
Recommended reading
Still need help?
If this guide didn’t solve your issue, our team can help you via ticket.