- Plesk for Linux
PHP script runs successfully when PHP 5.x is used in cronjob or under Plesk > Domains > example.com > Scheduled Tasks.
After changing PHP handler to PHP 7.x the cronjob or Scheduled Task does not run properly.
Executing the script manually shows the following error:
# /opt/plesk/php/7.0/bin/php -f /var/www/vhosts/example.tld/httpdocs/script.php
PHP Fatal error: No mysql extension for PHP loaded in var/www/vhosts/example.tld/httpdocs/script.php on line 42
mysql extension is removed in PHP 7.x, but
script.php uses this extension.
script.phpto use the extension
mysqliwhich is supported by PHP 7.x. Contact the developer of the script if necessary.
- Change the PHP handler used by the script to PHP 5.x according to the article How to change PHP settings/version for a domain in Plesk?