How to Set Up or Force Cron Jobs to Use a PHP Version in WEBUZO

If you see your cron jobs not working properly, it can happen for the wrong PHP run time. In this situation, the solution is to force-run Cron Jobs with a specific PHP version.

As we know we have two types of PHP versions in the current world, one Easy Apache (EA) PHP and another Alter (alt) PHP. Here we will give the example of “php /home/demo-user/corn.php” for this cron job command.

For ea PHP use:
PHP 5.6: /usr/local/apps/php56/bin/php /home/demo-user/corn.php
PHP 7.0: /usr/local/apps/php70/bin/php /home/demo-user/corn.php
PHP 7.1: /usr/local/apps/php71/bin/php /home/demo-user/corn.php
PHP 7.2: /usr/local/apps/php72/bin/php /home/demo-user/corn.php
PHP 7.3: /usr/local/apps/php73/bin/php /home/demo-user/corn.php
PHP 7.4: /usr/local/apps/php74/bin/php /home/demo-user/corn.php
PHP 8.0: /usr/local/apps/php80/bin/php /home/demo-user/corn.php
PHP 8.1: /usr/local/apps/php81/bin/php /home/demo-user/corn.php
PHP 8.2: /usr/local/apps/php82/bin/php /home/demo-user/corn.php
Future PHP X.x: /usr/local/apps/phpXx/bin/php /home/demo-user/corn.php

For cloudlinux/alt PHP use:
PHP 5.6: /opt/cloudlinux/alt-php56/root/usr/bin/php /home/demo-user/corn.php
PHP 7.0: /opt/cloudlinux/alt-php70/root/usr/bin/php /home/demo-user/corn.php
PHP 7.1: /opt/cloudlinux/alt-php71/root/usr/bin/php /home/demo-user/corn.php
PHP 7.2: /opt/cloudlinux/alt-php72/root/usr/bin/php /home/demo-user/corn.php
PHP 7.3: /opt/cloudlinux/alt-php73/root/usr/bin/php /home/demo-user/corn.php
PHP 7.4: /opt/cloudlinux/alt-php74/root/usr/bin/php /home/demo-user/corn.php
PHP 8.0: /opt/cloudlinux/alt-php80/root/usr/bin/php /home/demo-user/corn.php
PHP 8.1: /opt/cloudlinux/alt-php81/root/usr/bin/php /home/demo-user/corn.php
PHP 8.2: /opt/cloudlinux/alt-php82/root/usr/bin/php /home/demo-user/corn.php
Future PHP X.x: /opt/cloudlinux/alt-phpXx/root/usr/bin/php /home/demo-user/corn.php

Was this article helpful?

Related Articles

Leave A Comment?