Knowledge Base
Cron Job Not Running
Cron Job Troubleshooting
If your scheduled cron jobs aren't running, follow these troubleshooting steps.
Verify Cron Setup
In DirectAdmin:
- Go to Cron Jobs
- Verify your cron job exists
- Check the timing settings (minute, hour, day, month, weekday)
Common Issues
1. Incorrect Path
Use full absolute paths:
# Wrong php script.php # Correct /usr/local/bin/php /home/username/public_html/script.php
2. PHP Path
Find your PHP path:
- PHP 7.4: /usr/local/bin/php74
- PHP 8.0: /usr/local/bin/php80
- PHP 8.1: /usr/local/bin/php81
- Default: /usr/local/bin/php
3. Permissions
The script must be executable:
- File permissions: 755 or 644
- Check ownership is correct
4. Script Errors
Test your script manually first:
/usr/local/bin/php /home/username/public_html/cron.php
Check for any errors in output.
5. Output Capture
Redirect output to see what happens:
/usr/local/bin/php /home/username/public_html/cron.php >> /home/username/cron.log 2>&1
Check cron.log for output and errors.
WordPress Cron
WordPress has its own cron system that runs on page visits. For reliable execution:
Disable WP-Cron (wp-config.php):
define('DISABLE_WP_CRON', true);
Create Server Cron Job:
*/15 * * * * wget -q -O - https://yourdomain.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1
This runs WordPress cron every 15 minutes.
Testing Cron Jobs
- Set cron to run every minute temporarily
- Add logging to your script
- Check if log file is created/updated
- Reset to normal schedule once working