DEV Community

ShoHost
ShoHost

Posted on Originally published at blog.shohost.com

Your WHMCS Cron Stopped. Nobody Noticed for a Week.

A dead WHMCS cron doesn't throw an error page. Invoices simply stop going out, overdue services stay active, and the first alarm is usually a client asking why they never got a bill.

When it happens, the first job is to work out which kind of failure you have, because the fixes are different:

  • Never called vs. called and crashing. The Cron Status report behind the Automation Status badge tells you. If Cron Setup and Invocation Frequency fail, cron never reaches WHMCS. If only Daily Cron Completing fails, it starts and dies partway.
  • Run it by hand, loudly. Running cron.php all -F -vvv from SSH as the account that owns WHMCS prints the real [ERROR] line instead of a coloured badge. Do it once, not on a schedule.
  • The usual suspect is PHP. The bare php in a crontab is whatever comes first in cron's PATH, which often isn't the version your site uses, and it may not have the ionCube Loader.
  • Check the clock too. If CLI PHP and web PHP disagree on timezone, the daily run can keep missing your Time of Day hour.

"Works in SSH, fails in cron" almost always comes down to that different environment.

The guide covers ten causes in the order we'd check them on a real server, with the commands, sample output, a post-fix checklist and prevention tips. Read the full WHMCS cron troubleshooting walkthrough on the ShoHost blog.

Top comments (0)