FluxBilling

WHMCS Cron Job: The Command, Status Checks and Common Fixes

The WHMCS cron command, how often it must run, how to read Automation Status, and fixes for the errors that stop it, from path mistakes to PHP version mismatches.

Mario MarinMario Marin8 min read

The WHMCS cron job is a system cron entry that runs crons/cron.php with PHP's command-line binary every five minutes, for example */5 * * * * php -q /home/username/crons/cron.php. WHMCS shows the exact command for your installation under Configuration, System Settings, Automation Settings. If the cron does not run at least once an hour, and at least once during the hour you set as Time of Day, invoices, reminders, card charges and suspensions stop happening.

How this was sourced. FluxBilling publishes this guide and sells billing software that competes with WHMCS. Every command, error and setting below comes from the WHMCS 9.1 documentation on docs.whmcs.com, read on 23 November 2026. It applies to self-hosted WHMCS only: WHMCS Cloud sets up the cron for you. The guide covers the command, the schedule, how to check the status, the common errors and their fixes, and how a platform with a built-in scheduler differs.

What does the WHMCS cron job do?

Almost everything WHMCS does while nobody is logged in. One script, cron.php, decides on each run which tasks are due. Most run once a day, some every few minutes, a few once a month.

Task (cron.php option)What it doesFrequency
--CreateInvoicesGenerates renewal invoicesDaily
--ProcessCreditCardPaymentsCharges stored payment methodsDaily
--InvoiceRemindersUnpaid and overdue remindersDaily
--AutoSuspensions, --AutoTerminationsSuspends and terminates overdue servicesDaily
--TicketEscalationsApplies escalation rulesAs often as every three minutes
--RunJobsQueue, --ProcessEmailQueueQueued jobs and campaign emailsAs often as every five minutes
--DomainStatusSyncSyncs active domain statusesAs often as every hour
--OverageBillingBills overage usageMonthly

WHMCS never runs a task more often than its schedule allows, so calling the script every five minutes is safe.

What is the WHMCS cron command?

Copy it from Configuration, System Settings, Automation Settings, by clicking the first badge. On a typical server it looks like this:

*/5 * * * * php -q /home/username/crons/cron.php

In cPanel, add it under Advanced, Cron Jobs with "Once Per Five Minutes". In Plesk, add a Scheduled Task with the script path, a compatible PHP version and the cron style */5 * * * *. In DirectAdmin, use the full path to the PHP binary, such as /usr/local/bin/php. Without a panel, run crontab -e as the account that owns WHMCS and add the line there.

Use the command line, not a web request. By default WHMCS answers direct HTTP requests to cron.php with 403 Access Denied, unless the caller's IP address is listed in the Cron HTTP Access Restriction setting.

How often should the WHMCS cron run?

Every five minutes. The documented minimum is once an hour, but frequent tasks such as ticket escalations and the jobs queue only keep up at the recommended interval.

The daily tasks run once, at the hour set in Time of Day under Automation Settings. The default is 9:00 local server time. The tasks start the first time the cron is invoked during that hour, so a cron that runs only at 8:00 and 10:00 never runs them at all. WHMCS uses the PHP time when cron.php runs, so the WHMCS timezone must match the server's.

How do you check whether the WHMCS cron is running?

Open Utilities, Automation Status, or click the gear icon in the admin area. The badge at the top tells you where to look.

BadgeMeaning
Ok (green)Cron invoked within the last 120 minutes and the daily tasks ran within 24 hours
Warning (yellow)Cron ran before, but not in the last 120 minutes
Error (red)Cron never invoked, or the daily tasks have not run in 24 hours

Also check the Activity Log under Configuration, System Logs. Each day should show entries starting with "Cron Job" and end with "Cron Job: Completed". No such entries means the cron job itself is not configured. After a fix, wait five minutes and click Refresh on Automation Status.

Why is the WHMCS cron not running?

The exact message decides the fix. These seven come from the cron troubleshooting section of the WHMCS documentation:

Error or symptomCauseFix
No input file specified, or Could not open input fileWrong path to cron.phpCorrect the path in the cron command
Unable to communicate with the WHMCS installationMoved crons folder cannot find WHMCSSet $whmcspath in crons/config.php
Allowed memory size of 33554432 bytes exhaustedmemory_limit is 32 MBRaise it to 128 MB, or 64 MB at least
Maximum execution time of 30 seconds exceededmax_execution_time is 30Use 120, or 300 on large installations
Call to undefined function curl_init()cURL missing in the CLI PHPInstall cURL and enable curl_init for that PHP
Daily System Cron Attention Needed emailCron did not run during the Time of Day hourRun it every five minutes
Daily run slow at Executing System QueueDatabase backups on a large databaseClean up the database, turn off FTP and email backups

For memory and time limits you can also set the value in the command itself:

php -d memory_limit=128M -d max_execution_time=300 -q /path/to/whmcs/crons/cron.php

How do you fix a cron PHP version mismatch?

Many servers run a different PHP binary and php.ini on the command line than in the web server. WHMCS 9.1 supports PHP 8.2, 8.3 and 8.4 with ionCube Loader 15 or later, and both sides must use the same version.

  1. In WHMCS, open Utilities, System, PHP Info and note the Loaded Configuration File. A path such as /opt/cpanel/ea-php83/root/etc/php.ini means PHP 8.3.
  2. Log in over SSH as the account that runs the cron, not as root, and run php -i | grep "Loaded Configuration File".
  3. If the versions differ, point the cron at the right binary, or change the account's PHP version in your panel.
  4. Compare date.timezone on both sides too. A timezone mismatch makes the daily run miss its hour.

The System Health warning is cached and only clears after the next daily run.

How do you run the WHMCS cron by hand to debug it?

Turn on Display Errors under General Settings, Other, then run the command with all tasks, forced, at maximum verbosity:

php -q /home/example/public_html/whmcs/crons/cron.php all -F -vvv

It ends with a green [OK] Completed when everything works. WHMCS says not to do this more than once in 24 hours, because -F forces the daily tasks again. If it succeeds by hand but fails on schedule, append -vvv >> crondebug.txt to the scheduled command and read the file after the Time of Day hour.

To give one task its own schedule, skip it in the main command and run it with do, for example cron.php skip --AutoSuspensions every five minutes plus 0 9 * * 1-5 php -q /path/to/cron.php do --AutoSuspensions for weekday mornings only.

How do you move the WHMCS crons directory?

WHMCS recommends moving crons above the web root. Move the folder, rename config.php.new to config.php and set $whmcspath in it, add $crons_dir to configuration.php, then update the cron command and any email piping forwarders. After every WHMCS update, copy the new crons files into the custom folder, or automation breaks. Our WHMCS security checklist covers the other hardening steps, and the guide to moving WHMCS to a new server covers re-creating the cron after a move.

How does billing work without a system cron?

FluxBilling runs its scheduler inside the application, so there is no crontab line and no command-line PHP to keep in step with the web server, on our cloud or on a self-hosted install. All billing lifecycle work runs in one daily pass at an hour you pick in UTC: renewal documents, automatic charges, suspension, termination, reminders and a billing integrity check that compares documents with the money recorded against them.

Only one pass runs at a time, and a failing step does not stop the steps after it. If the platform was down at the scheduled hour, it runs the pass as a catch-up when it starts, once 23 hours or more have passed since the last completed one. Hourly services have their own pass every hour, on the hour.

The trade-off is control. WHMCS lets you skip, force or separately schedule any task. FluxBilling runs one daily pass in a fixed order.

WHMCS cron FAQ

What is the default WHMCS cron time?

Daily automation runs at 9:00 local server time by default. Change it under Automation Settings, Time of Day, and make sure the cron runs at least once in that hour.

Can the WHMCS cron run every minute?

Yes. WHMCS never runs a task more often than its own schedule, and ticket scheduled actions can run as often as every minute. Every five minutes is the documented recommendation.

Why did WHMCS not generate invoices?

Check whether the cron ran during the Time of Day hour. If it did not, the daily tasks, invoice generation included, did not run. The Automation Status badge and the Activity Log entry "Cron Job: Completed" show it.

Does WHMCS Cloud need a cron job?

No. WHMCS Cloud handles automation and the system cron itself. The steps in this guide are for self-hosted installations.

Can I trigger the WHMCS cron with wget?

Only if the caller's IP address is in the Cron HTTP Access Restriction setting. Otherwise WHMCS returns 403 Access Denied, so the command line is the safer choice.

Next step

If you would rather not maintain a cron job, a PHP version and a crons folder alongside your billing, see what changes on our WHMCS alternative page. The official WHMCS System Cron documentation lists every task and option.

WHMCS, cPanel, Plesk and DirectAdmin are trademarks of their respective owners. FluxBilling is not affiliated with or endorsed by any of them.

Tagged
whmcs cron jobwhmcs cron not runningwhmcs cron commandwhmcs cron.phpwhmcs automation statuswhmcs cron php version mismatchwhmcs cron time of daywhmcs move crons directorywhmcs cron every 5 minuteswhmcs daily cron not running
Written by
Mario Marin
Mario Marin
View all posts →