Forcing cron Jobs to Use The Chosen php Version

Forcing Cron jobs to use Chosen PHP Version

Cron jobs may not always work with the set of php version set because some applications may use specific versions. Therefore its only wise to adjust the application command code to suit the server default settings.

 

How To Force cron jobs to work with chosen php version;

  • Login to cpanel
  • Navigate to advanced header and click on cron jobs
  • click on edit in one of the cron jobs set up already
  • Replace the crons version with the version of your server for instance (php-q /home/userna5/public_html/cronscript.php with (/opt/php54/bin/php -q) so that it reads as(/opt/php52/bin/php -q /home/userna5/public_html/cronscript.php). Php-q means version and the rest means path. Click edit again to save it.
  • The new code means that the cron job will have to use the php replaced with.

 

Was this article helpful?

Related Articles

Leave A Comment?