• Plesk Uservoice will be deprecated by October. Moving forward, all product feature requests and improvement suggestions will be managed through our new platform Plesk Productboard.
    To continue sharing your ideas and feedback, please visit features.plesk.com

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
 
Info:
if you use the 8.2 PHP Version then use this command ,
/opt/plesk/php/8.2/bin/php -q /var/www/vhosts/domain.com/httpdocs/whmcs/crons/pop.php
Do not forget the domain.com to your Domain Name.
 
Back
Top