Deprecated: Function ereg() is deprecated when install Drupal
At previous post about install drupal in localhost using wamp I got this message :
Deprecated: Function ereg() is deprecated in C:\wamp\www\drupal\includes\file.inc on line 902
That message appear because I use latest wamp software that utilize php 5.3.0 where ereg() function is deprecated.
Quick solution for this case are :
1. Downgrade wamp to previous version
or
2. Edit php source file of drupal.
I prefer to choose second solution since I love to learn new thing
I have tried a few php function like preg_replace() and mb_ereg()
After test each function I think mb_ereg() is good solution.
Back to the problem I open file :
file.inc
C:\wamp\www\drupal\includes\file.inc
scroll to line 902.
change ereg in line to mb_ereg to make the line transform into :
elseif ($depth >= $min_depth && mb_ereg($mask, $file)) {
Save the file and retry open http://batikweb.com
This time I got this :
Nice, I can continue to installation steps
Stay health!
-
Recommended Drupal Books :
-
Using Drupal
-
Pro Drupal Development, Second Edition
-
Drupal For Dummies
- Front End Drupal: Designing, Theming, Scripting
- Leveraging Drupal: Getting Your Site Done Right
- Learning Views for Drupal (DVD)
- How to Theme Drupal: From Blank to Beautiful in 2 Hours (DVD)
- Learning CCK for Drupal (DVD)
- Drupal Essential Training
Related Reading:
Using DrupalWith the recipes in this book, you can take full advantage of the vast collection of community-contributed modules that make the Drupal web framewo... Read More >
Drupal For DummiesLearn to set up, manage, and administer a Drupal Web site
Drupal offers unparalleled flexibility for content-managed Web sites, but most ... Read More >
Pro Drupal Development, Second EditionWidely praised for its in–depth coverage of Drupal internals, bestselling Pro Drupal Development has been completely updated for Drupal 6 in thi... Read More >
Front End Drupal: Designing, Theming, Scripting“For Drupal to succeed, we need books like this.”
–Dries Buytaert, Drupal founder and project... Read More >
Cracking Drupal: A Drop in the BucketThe first book to reveal the vulnerabilities and security issues that exist in the sites that have been built with Drupal?and how to prevent them from... Read More >
Search Terms :
If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.



Thanks really helpful
ok
excelent
Thanks for this very usefull information !
Excelent!!!!
It works for drupal 6.14
Thanks a lot! It worked for 6.14
Thanks a lot. I dont have admin access. Older WAMP requires admin access. Your patch as per 2 helped to work on Drupal w/o 902
Worked for me. Thanks
Thanks you very much! its works immediately
Thanks, worked like a charm.
Excellent! Thank you very much!
THANKS!!!
Thanks alot solved my issue aswell
You’re the man!
Still works in 6.16
Nice work!
OK, funciona al 100%
Gracias !!!
thank u so much……it worked for me……………..yipeeeeeeeeeeeee
cheers, don’t get why this hasn’t gone into core yet.
its line 911 on drupal 6.16
good post!! it worked, spent many hours trying to fix it
3 character – large effect !
Great job – Thanks a lot.
great job thank you…. you safe my life
Thank you for this effort. You saved me hours of time!!
cheers, don’t get why this hasn’t gone into core yet.
its line 911 on drupal 6.1
Thank you too. It works in Drupal 6.16 at line 911
Very helpful. Thank you for sharing.
Ok, you are the man,……..thanks a lot
Thank! It’s work!
Go to test drupal
Exactly what I need!
Hi man,
Thanks a lot for this solution. Great Job!
But I have a question:
Is the php function (ereg) equivalent to (mb_ereg) ? I mean does it do the same functionality for the include “file” in drupal, or it might result in a code weakness in future use of the function? Sorry, but I was not sure why it wasn’t amended by drupal core upon php 5.3 version! that what confused me not your fix
Keep it up..
You can refer to manual, IMHO the code don’t show code weakness for future.
Ok, I amended it & works perfectly !! thanks again
Thanks
i got solution after read from your site thanks once again, i also got solution in eCommerce site where i was get same error. that was also solved.
you really have new thing to developed and accept challenging error thanks a lot.
Thanks… It works well.
It’s very useful.thx