• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

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