Introduction
Much of WHMCS automation depends on something most hosting business owners set up once and then forget: the cron job. Get it right and invoices generate automatically, renewal reminders send on schedule, and domains register without manual intervention. Get it wrong and your billing operation silently grinds to a halt.
What Does the WHMCS Cron Job Do?
The WHMCS cron job is a scheduled task that runs the automation engine at regular intervals. Each time it runs, it:
- Generates invoices for upcoming renewals
- Sends payment due and overdue reminders
- Suspends and terminates services for non-payment
- Registers, renews, and transfers domains
- Processes automatic credit card charges
- Runs domain WHOIS updates
Recommended Cron Job Frequency
WHMCS recommends running the cron job once every five minutes. Running it less frequently causes delays in all automation functions.
The Correct WHMCS Cron Command
To run every five minutes:
*/5 * * * * /usr/local/bin/php -q /home/yourusername/public_html/crons/cron.php > /dev/null 2>&1
Replace the PHP path and file path with your actual server values. Use which php via SSH to find your PHP CLI path.
Setting Up in cPanel
- Log into cPanel and navigate to Cron Jobs
- Select "Once Per 5 Minutes" from Common Settings
- Enter your cron command and click Add New Cron Job
Common Mistakes
- Wrong PHP version: The default PHP CLI may be outdated. Confirm PHP 7.4+ is used.
- Incorrect file path: A typo causes silent failure. Verify the path first via SSH.
- Running too infrequently: Once per hour causes significant automation delays.
- Not monitoring output: Initially log output to a file to detect errors.
How to Verify Your Cron Is Running
In WHMCS admin, go to Utilities > Logs > Cron Log. You should see entries every five minutes. Empty or stale logs mean your cron is not running.
Conclusion
The WHMCS cron job is the heartbeat of your billing automation. Set it up correctly, verify it is running, and check the cron log periodically. A silent cron failure can cost you revenue through missed renewals and unprocessed payments.