Cron Configuration
Contents
Setting Up Cron Jobs
We recommend you run the cron once per day to avoid your customers receiving duplicate emails for overdue notices etc. The following information will aid you in setting up your Admin cron (invoice generation etc) on different Control Panels and environments.
The examples below will setup the cron to run at 9am every day.
cPanel
We have prepared a video tutorial for this section: http://whmcs.com/tutorials.php?i=1
Click on the Cron Job link in cPanel and then click the Standard button.
Alternatively click the Advanced (Unix Style) button and use the following:
Option | Minute | Hour | Day | Month | Weekday | Command | ||
---|---|---|---|---|---|---|---|---|
a) | 0 | 9 | * | * | * | php -q /path/to/home/public_html/whmcspath/adminpath/cron.php | ||
b) | 0 | 9 | * | * | * | wget -O http://www.yourdomain.com/whmcspath/adminpath/cron.php >/dev/null | ||
c) | 0 | 9 | * | * | * | get http://www.yourdomain.com/whmcspath/adminpath/cron.php |
Direct Admin
the command for Direct Admin is generall the same as cPanel, however, you need to reference the full path to the php binary.
This can be /usr/bin/php, /usr/bin/home/php or /usr/local/bin/php but this is dependent on the server setup and you should check with your Server Administrator for the full path to the php binary.
An example command to run is:
Command |
---|
/usr/bin/php -q /home/demo_user/domains/testdomain.com/public_html/whmcspath/admin/cron.php |
/usr/local/bin/php -q /home/demo_user/domains/testdomain.com/public_html/whmcspath/admin/cron.php |
wget -O http://www.yourdomain.com/whmcspath/admin/cron.php |
GET http://www.yourdomain.com/whmcspath/admin/cron.php |
Windows Server / DotNetPanel
Depending on your server setup, you can run the cron directly from the php executable. If this is not possible, you would need to use the server browser to run the cron
An example command to run is:
Command |
---|
C:\php\php.exe -q "C:\inetpub\wwwroot\whmcs7\admin\cron.php" |
"c:\program files\internet explorer\iexplore.php" "http://www.yourdomain.com/whmcspath/cron.php" |
You should then set the task to run at a certain time every day. The time is up to you.
Plesk
The Windows version of Plesk is slightly different. You need to specify the path to the php executable and then specify the path to your cron.php file.
Check the appropriate boxes to run at the time you wish and press ok to save.