• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • Support for BIND DNS has been removed from Plesk for Windows due to security and maintenance risks.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS.

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