Tuesday 22 February 2011

Joomla error: Deprecated: Function eregi() is deprecated in... sef.php (Joomla 1.x error with php 5.3)

Deprecated: Function eregi() is deprecated in... sef.php (Joomla 1.x error with php 5.3)

Download from here the fixed sef.php file. Unzip, rename fixed file to sef.php and upload to joomla's /includes directory.



Info about this error and how to fix it:

http://devthought.com/2009/06/09/fix-ereg-is-deprecated-errors-in-php-53
http://takien.com/513/how-to-fix-function-eregi-is-deprecated-in-php-5-3-0.php

Very important:
Notice that I wrapped the pattern (\.([^\.]*$)) around / /, which are RegExp delimiters. If you find yourself escaping / too much (for an URL for example), you might want to use the # delimiter instead.

Another patch for error Parameter 2 to frontpage() expected to be a reference (Joomla 1.x error with php 5.3).

You can also disable error reporting if you have server access, go to your php.ini (global is /usr/local/lib/php.ini) and find the display_errors section and change it to Off. This is a temporary fix though as deprecated functions will cause your site to crash when a future php version will not support them at all and error reporting is crucial so that you know what goes on.

No comments: