Admin
Moderating
Donor Member
Master Member
Elite Member
Active Member
- May 31, 2020
- 2,980
- 1,693
WHMCS relies on cron jobs to handle invoicing, payment reminders, automation, ticket notifications, order provisioning and suspension tasks. The cron must run properly and ionCube Loader also needs to be active for CLI PHP, otherwise cron will fail silently.
php -q /home/USER/public_html/whmcs/crons/cron.php
If cron is not triggering or you see errors, create a support thread and include your PHP version, ionCube status and cron output.
1. Core Cron Command
The main WHMCS cron file path: crons/cron.phpBasic command template (replace your full WHMCS directory path):php -q /home/USER/public_html/whmcs/crons/cron.php
Critical note: Use the same PHP version for CLI as your web PHP. CLI PHP needs ionCube Loader enabled separately; web php.ini ≠ CLI php.ini.
2. Recommended Cron Schedule
WHMCS official recommendation: run every 5 minutesCrontab expression:*/5 * * * * php -q /home/USER/public_html/whmcs/crons/cron.php
3. How to add cron
Option A: cPanel / DirectAdmin Web UI
- Login cPanel, go to Cron Jobs
- Select */5 * * * * for timing
- Paste your full php cron command
- Save. You may set email notifications for cron output for debugging.
Option B: SSH crontab (Linux server)
- SSH login, type
crontab -e
- Paste the cron line at bottom
- Save and exit editor
- Check active cron list:
crontab -l
4. Verify Cron works inside WHMCS admin
- Log into WHMCS Admin
- Navigate to Utilities > System Status
- Scroll to Cron Information section
- Check “Last Cron Run” timestamp. If time never updates, cron is not executing.
- If cron ran but shows warning, review the cron output log.
5. Common troubleshooting points
- CLI missing ionCube LoaderWeb page works fine, but cron does nothing. Create phpinfo for CLI: php -i and confirm ionCube is loaded. Edit CLI php.ini to add ioncube zend_extension.
- Wrong PHP binarySome servers have multiple PHP versions. Use which php or which php81 to call exact PHP binary. Example for PHP 8.1:
*/5 * * * * /usr/local/bin/php82 -q /home/USER/public_html/whmcs/crons/cron.php
- File permission issueThe crons/cron.php file needs read permission (644). The WHMCS attachments, templates_c folders need write permissions.
- Cron output errorDisable email flood: add > /dev/null 2>&1 at end of command to suppress mail alerts after you finish debugging
*/5 * * * * php -q /home/USER/public_html/whmcs/crons/cron.php > /dev/null 2>&1
- Path errorUse absolute full path instead of relative path. Double check the location of cron.php.
6. Security recommendations
- Do not expose cron.php to public web access. Restrict access via .htaccess/Nginx rules.
- Run cron under the same web hosting user, avoid running cron as root.
- Monitor cron execution logs regularly.
- Always backup WHMCS database before major changes to cron or addons.
If cron is not triggering or you see errors, create a support thread and include your PHP version, ionCube status and cron output.