Application installation or update fails: Function ereg() is deprecated

Created:

2016-11-16 12:49:32 UTC

Modified:

2017-04-24 12:10:35 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Application installation or update fails: Function ereg() is deprecated

Applicable to:

  • Plesk 11.5 for Linux

Symptoms

Installing an application concrete5 from Application Vault fails with error:

Deprecated: Function ereg() is deprecated in /opt/psa/var/apspackages/apscatalogXqyz3g.zipa1c21d85-8b90-1a/cache/scripts/db-util.php on line 40'"

OR

Unable to update Prestashop application, the following error appears:

Error: Error en la actualización: Non-zero exit status returned by script. Output stream: 'PHP Deprecated: Function ereg() is deprecated in /usr/local/psa/var/apspackages/apscatalogMNrDAK.zip2c07078a-3762-0e/cache/scripts/db-util.php on line 40 '. Error stream: 'PHP Deprecated: Function ereg() is deprecated in /usr/local/psa/var/apspackages/apscatalogMNrDAK.zip2c07078a-3762-0e/cache/scripts/db-util.php on line 40 '.

PHP 5.3.3 or later is installed on the server:

[root@plesk]# php -v
PHP 5.4.16 (cli) (built: Jun 25 2015 12:52:35)

Cause

Function ereg() was deprecated in PHP 5.3.

Resolution

Edit file db-util.php : replace ereg function with preg_match and add / delimiter after first and before the last quote:

before

if(!ereg("^[ \

\r\ ]*$", $statement))

after

if(!preg_match("/^[ \

\r\ ]*$/", $statement))

Have more questions? Submit a request
Please sign in to leave a comment.