Configure the System Cron Job

When you set up your WHMCS installation, you must set up the system cron to automate WHMCS’s many tasks. The system cron is a system daemon that executes tasks at designated times. WHMCS includes processes that must run on a periodic basis via the cron.

For more information, see System Cron.

Find the Cron Command

You can find the correct command to copy-and-paste for your WHMCS installation by going to Configuration () > System Settings > Automation Settings and clicking on the first badge:

Automation Settings badges

The command appears under Cron Command. Click the copy icon to copy the command to your clipboard.

Configure the Cron Command

You must also configure the Time of Day setting at Configuration () > System Settings > Automation Settings. For more information, see Configure When Daily Tasks Run

The method that you use to configure the cron job depends on your control panel:

cPanel

To configure the cron command in cPanel:

  1. Log in to the cPanel account that hosts your WHMCS installation.
  2. Go to Home » Advanced » Cron Jobs.
  3. Select Once Per Five Minutes from Common Settings.
  4. Paste the cron command into Command.
  5. Click Add New Cron Job.

Alternatively, click Advanced (Unix Style) and enter one of the following options:

MinuteHourDayMonthWeekdayCommand
*/5****php -q /path/to/home/public_html/whmcspath/crons/cron.php
*/5****wget -O http://www.example.com/whmcspath/crons/cron.php >/dev/null
*/5****GET http://www.example.com/whmcspath/crons/cron.php
For more information, see cPanel’s Cron Jobs documentation.

Plesk

To configure the cron command in Plesk:

  1. Log in to the Plesk account that hosts your WHMCS installation.

  2. Go to Scheduled Tasks for your installation’s domain.

  3. Click Add Task.

  4. Enter the path to the cron.php script for Script path. For example:

    /path/to/whmcs/crons/cron.php

  5. Select a compatible PHP version.

  6. Select Cron style for Run and enter */5 * * * *.

  7. Click OK.

DirectAdmin

To configure the cron command in DirectAdmin:

  1. Log in to the DirectAdmin account that hosts your WHMCS installation.
  2. Go to Advanced Features » Cron Jobs.
  3. Click Create Cron Job.
  4. Enter */5 for Minute.
  5. Enter * for Hour, Day of Month, Month, and Day of Week.
  6. Paste the cron command into Command.
  7. Click Create.

When you configure the system cron for DirectAdmin, you must include the full path to the PHP binary in the cron command.

Depending on your server, this will be /usr/bin/php, /usr/bin/home/php, or /usr/local/bin/php. Check with your hosting provider or system administrator for the full path to the PHP binary.

For example, you could use the following commands for some server configurations:

  • /usr/bin/php -q /home/demo_user/domains/testdomain.com/public_html/whmcspath/crons/cron.php
  • /usr/local/bin/php -q /home/demo_user/domains/testdomain.com/public_html/whmcspath/crons/cron.php
  • wget -O /dev/null http://domain.tld/path/to/cron.php
  • GET http://www.example.com/whmcspath/crons/cron.php

No Control Panel

If you do not use a control panel, you can configure a new crontab entry by running the following command:

crontab -e

On a new line in the file, enter the following command, replacing /path/to/home/ with the path to your WHMCS installation:

*/5 * * * * php -q /path/to/home/public_html/whmcspath/crons/cron.php

Save the changes to the file when you are finished.

Last modified: October 25, 2024