PHP 5.3 and osCommerce

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.
Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

Kai 'Oswald' Seidler writes about his life as co-founder of Apache Friends, creator of XAMPP, and technology evangelist for web tier products at Sun Microsystems.

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today