Deprecated: Function ereg() is deprecated in C:\wamp\www\drupal-6.14\includes\ on line 902


This message appear because I use latest wamp software that utilize php 5.3.0 where ereg() function is deprecated.


step 1: Goto Folder Drupal\includes

step 2: Select File “”

step 3:

Goto 902 Line

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

Change the function ereg to mb_ereg

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




  1. Hi,

    Thanku for ur post…its really working………………..

  2. Thank You. It works.

  3. Thanks A Lot For this code..
    It really works when installing drupal !!!

  4. Hi! this change doesn’t solve all the problems. There are several drupal modules that continue not working. See that:

    I use calendar and i cannot find any solution yet.


  5. NIce workk!!!!!!!!!!!!!!

  6. tnx it work for me in joomla.

  7. Its really helpful me . Thank you buddy

  8. Djamu · · Reply

    better solution is using the preg_match replacement

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


    elseif ($depth >= $min_depth && preg_match("/$mask/", $file)) {

  9. hafidzcyber · · Reply

    thanks guy ..

  10. NELSON · · Reply

    Good work. it real work for me lol

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s