wie setzen sie einen whmcs cron?

Summary
WHMCS relies on cron jobs for various administrative tasks such as invoicing, payment reminders, automation, ticket notifications, order provisioning, and suspension. The main topic revolves around setting up and maintaining effective cron jobs in WHMCS environments. Key information includes the core command template to run the cron.php file, recommended schedule of every 5 minutes, how to add a cron job using cPanel or SSH, verifying that the cron is working within WHMCS admin, troubleshooting common issues like missing ionCube Loader for CLI PHP, incorrect file permissions, and email flood errors. Security recommendations also include not exposing cron.php publicly, running it under the same web hosting user, monitoring logs, and backing up before making changes.
Admin
Moderating
Donor Member
Master Member
Elite Member
Active Member
Beigetreten
Mai 31, 2020
Nachrichten
2,980
Reaktionswert
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.

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​

  1. Login cPanel, go to Cron Jobs
  2. Select */5 * * * * for timing
  3. Paste your full php cron command
  4. Save. You may set email notifications for cron output for debugging.

Option B: SSH crontab (Linux server)​

  1. SSH login, type
  1. Paste the cron line at bottom
  2. Save and exit editor
  3. Check active cron list:

4. Verify Cron works inside WHMCS admin​

  1. Log into WHMCS Admin
  2. Navigate to Utilities > System Status
  3. 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​

  1. 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.
  2. 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
  1. File permission issueThe crons/cron.php file needs read permission (644). The WHMCS attachments, templates_c folders need write permissions.
  2. 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
  1. Path errorUse absolute full path instead of relative path. Double check the location of cron.php.

6. Security recommendations​

  1. Do not expose cron.php to public web access. Restrict access via .htaccess/Nginx rules.
  2. Run cron under the same web hosting user, avoid running cron as root.
  3. Monitor cron execution logs regularly.
  4. Always backup WHMCS database before major changes to cron or addons.
Important reminder:Cron failures will stop invoice generation, domain renewals, service suspension and automated emails. Test cron on staging environment first before applying to production.

If cron is not triggering or you see errors, create a support thread and include your PHP version, ionCube status and cron output.
 
Trending Resources
Zurück
Oben