Cron Job Issues

From WHMCS Documentation

Revision as of 09:43, 24 December 2015 by John (talk | contribs)

This page details some of the common problems and errors which might occur when running the WHMCS cron job.

Troubleshooting

There are several techniques available for troubleshooting problems which one may encounter with the cron job, in descending order of verbosity they are:

Run the cron job in your browser

Run the cron job from the server command line

  • Access your server command line
  • Copy the cron job command for the cron.php file from your server's cron tab
    crontab -u userName -l)
    
  • Execute the command you copied:
    php -q /path/to/whmcs/crons/cron.php
    
  • Examine the output for any errors.

Run the cron job from the server command line with debug flag

  • Access your server command line
  • Copy the cron job command for the cron.php file from your server's cron tab
    crontab -u userName -l)
    
  • Add the debug flag to the end of the cron command and execute it:
    php -q /path/to/whmcs/crons/cron.php debug
    
  • Examine the output for any errors.
  • The final line output should be "Completed (Time: x Memory: x.x)"


Common Errors

Site error: the file /path/to/crons/cron.php requires the ionCube PHP Loader ioncube_loader_lin_5.6.so to be installed by the website operator

Seeing this error output indicates that the PHP configuration for your WHMCS installation may be different than that used for the command line.

Please try running the following command at the server command line whilst logged in as the same user under which the cron job is running to see the version information for your PHP and ionCube configuration:

php -v

You should get an output along the lines of:

PHP 5.4.43 (cli) (built: Aug 2 2015 02:44:35)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
with the ionCube PHP Loader v4.7.5, Copyright (c) 2002-2014, by ionCube Ltd.

If the "with the ionCube PHP Loader" line is absent, this indicates that the Ioncube loaders are not available for this user. Please work with your hosting provider or server administrator to ensure that the Ioncube loaders are available to the cron job user.