WHMCS

Set up the WHMCS cron job and automation settings

Add the WHMCS system cron, configure invoice generation, payment reminders, suspension and termination, and check Automation Status so billing runs on its own.

IntermediateWHMCS2 min read

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.php

The path reflects where your crons folder is. Use the PHP binary of the same version that runs WHMCS.

Add the cron job

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

SettingWhat it doesTypical value
Time of DayWhen daily tasks runA quiet hour, e.g. 09:00
Enable SuspensionSuspend services with overdue invoicesOn, after 3–5 days
Send Suspension EmailNotify the clientOn
Enable UnsuspensionUnsuspend automatically when paidOn
Enable TerminationDelete overdue accountsOn, after 30+ days
Invoice Unpaid ReminderFirst reminder before dueOn
First/Second/Third Overdue ReminderReminders after due date1, 3, 7 days
Process Credit Card ChargesDays before due to capture tokens0–3
Auto Cancellation RequestsProcess end-of-period cancellationsOn
Close Inactive TicketsClose tickets awaiting reply72–168 hours
Domain SyncSync expiry and status with registrarsOn

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>&1 after testing.

Next steps

Was this guide helpful?

Still stuck?

Ask MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.