Drupal 6 and PHP 5.3, ereg deprecated
Posted by on 06 August 2012 05:42 PM

If you get errors on a Drupal 6 site after upgrading to PHP 5.3+, find the following line in includes/file.php:

        elseif ($depth >= $min_depth && ereg($mask, $file)) {

and modify it to read:

        elseif ($depth >= $min_depth && mb_ereg($mask, $file)) {

This should take care of any error messages regarding ereg being deprecated.

Credit goes to Jeremy Hixon for posting this fix.  His original page can be found at  Note that you should search for the line in question, rather than assume that it's at line 902, as Jeremy suggests in his post.

(0 vote(s))
Not helpful

Comments (0)
Post a new comment
Full Name:
CAPTCHA Verification 
Please enter the text you see in the image into the textbox below (we use this to prevent automated submissions).