X
  • PHP
    August 27, 2009

PHP 5.3 and osCommerce

Guest Author
Over the last weeks I got many emails from users complaining about problems running their PHP apps on PHP 5.3. Todays example is osCommerce 2.2:
Deprecated: Function eregi() is deprecated in /opt/lampp/htdocs/oscommerce/catalog/admin/includes/classes/language.php on line 87

The answer in this case is quite simple: the eregi() function as the whole ereg extension got deprecated with PHP 5.3 (see http://www.php.net/ChangeLog-5.php#5.3.0) and all PHP apps using this handy functions now need to update their code to use PCRE functions like preg_match().

To temporary work around this issue you may lower the error reporting level in your php.ini.

From:

error_reporting = E_ALL | E_STRICT

To:
error_reporting = E_ALL & ~E_DEPRECATED

With this setting PHP will prevent warnings about deprecated functions.
But since in PHP 6 the ereg extension will completely removed from PHP this is only a fix of the symptom. And as Frank N. Furter teached us many years ago, it's always better to:
[So I'll] remove the cause, but not the symptom.

And there is nothing to add.

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.