• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Resolved Cron job Issue

M. Ahmed

New Pleskian
I have Plesk Onyx installed on top of CloudLinux. I have installed WHMCS 7.1 for one of my clients. WHMCS requires a cron job to run every 5 minutes.
"*/5 * * * * php -q /var/www/vhosts/username/httpdocs/crons/cron.php"

Whenever I am trying to run this cron through Plesk, I am getting this error:

Task "php -q /var/www/vhosts/username/httpdocs/crons/cron.php" completed with error in 0 seconds, output:

PHP Fatal error:
The file /var/www/vhosts/username/httpdocs/crons/cron.php was encoded
with the PHP 5.6 ionCube Encoder and requires PHP 5.6 to be installed.
in Unknown on line 0


Really don't know what the problem is? Different php versions are already installed in plesk.
 
Cause: When you run "php", not the PHP-builds delivered with Plesk, but your OS PHP is used. That is normally a lower release version.

Solution to use 5.6 instead:
1) # /usr/local/psa/bin/php_handler --list
Identify the line with PHP 5.6, e.g.
Code:
      plesk-php56-cgi               5.6.29         5.6.29       5.6      cgi   /opt/plesk/php/5.6/bin/php-cgi  /opt/plesk/php/5.6/bin/php  /opt/plesk/php/5.6/etc/php.ini     true disabled
  plesk-php56-fastcgi

2) Instead of using the command
Code:
*/5 * * * * php -q /var/www/vhosts/username/httpdocs/crons/cron.php
use the PHP interface that you have identified in step (1), for example
Code:
*/5 * * * * /opt/plesk/php/5.6/bin/php -q /var/www/vhosts/username/httpdocs/crons/cron.php
 
Back
Top