WHMCS relies on a single cron job to do its daily work: generating invoices, charging cards, sending reminders, suspending overdue services and syncing domains. If the cron does not run, billing silently stops. This guide sets it up correctly and explains each automation option.
Before you start
- WHMCS installed and an administrator login.
- Access to the hosting control panel to add a cron job (cPanel, Plesk or DirectAdmin).
Find the cron command
Go to Configuration → System Settings → Automation Settings. At the top WHMCS shows the exact command, for example:
*/5 * * * * /usr/local/bin/php -q /home/user/whmcs_data/crons/cron.phpThe path reflects where your crons folder is. Use the PHP binary of the same version that runs WHMCS.
Add the cron job
- cPanel: Advanced → Cron Jobs, choose Once Per Five Minutes and paste the command (without the schedule part). See cron jobs in cPanel.
- Plesk: Scheduled Tasks → Add Task → Run a PHP script. See scheduled tasks in Plesk.
- DirectAdmin: Advanced Features → Cron Jobs. See cron jobs in DirectAdmin.
WHMCS runs its daily tasks once per day at the Time of Day you set, and other tasks (email import, queue processing) every run.
Key automation settings
| Setting | What it does | Typical value |
|---|---|---|
| Time of Day | When daily tasks run | A quiet hour, e.g. 09:00 |
| Enable Suspension | Suspend services with overdue invoices | On, after 3–5 days |
| Send Suspension Email | Notify the client | On |
| Enable Unsuspension | Unsuspend automatically when paid | On |
| Enable Termination | Delete overdue accounts | On, after 30+ days |
| Invoice Unpaid Reminder | First reminder before due | On |
| First/Second/Third Overdue Reminder | Reminders after due date | 1, 3, 7 days |
| Process Credit Card Charges | Days before due to capture tokens | 0–3 |
| Auto Cancellation Requests | Process end-of-period cancellations | On |
| Close Inactive Tickets | Close tickets awaiting reply | 72–168 hours |
| Domain Sync | Sync expiry and status with registrars | On |
Warning: termination deletes accounts and their data on the server. Set it long enough for late payers, and make sure server backups exist.
Check that the cron runs
- Go to Utilities → Automation Status. It shows the last run time and the results of each daily task.
- Utilities → System → System Health warns if the cron has not run recently.
- Run it manually from SSH for detailed output:
php -q crons/cron.php all -vvv.
Troubleshooting
- "Cron has not run in the last 24 hours": the cron entry is wrong. Check the path, the PHP binary and that the file is readable.
- ionCube error in cron output: the command-line PHP is a different version without ionCube. Use the full path to the correct PHP binary.
- Invoices not generated: the daily task already ran today, or Invoice Generation days are set to 0.
- Too many cron emails: add
>/dev/null 2>&1after testing.
