Wordpress Fatal error: Call to undefined function _deep_replace()…pluggable.php on line 884

by dave on July 18, 2009



Today when I downloaded wordpress 2.8.1 to set it up locally and test a theme for blog pro-pakistan I got an error that was probably because of an upgrade where as all of my settings remained the same. I searched for this all over the web but couldn’t find the solution so tried myself to find a work around. I am not sure if this is the solution but this definately is the wrok around and it worked for me. Note that this error occurs the first time user sets up the wordpress 2.8.1.

fatalerror1

So here is the work around:

  • Open the pluggable.php (it is present in your wp-includes folder). You can simply open it in notepad
  • Now search (Ctrl+F) the keyword that his highlighted in error. You can search the word ‘deep’ or the full phrase i.e. _deep_replace

fatalerror2

  • Now  delete the line “ $location = _deep_replace($strip, $location); ” from your file and save it
  • Upload the file to your host server if this is not your localhost.
  • I experimented another thing with this problem and that worked too: i replaced my old file pluggable.php from the 2.7 version.
  • So you can choose any workaround that works for you.

If you have experimented to find a novel work around for this teasing problem, do post your comments or simply give your feedback if you were able toovercomethis issue.

Related Articles:

  1. WAMP SERVER error: localhost goes to www.localhost.com
  2. Troubleshot: Warning: Cannot modify header information – headers already sent by (output started at… [WORDPRESS]
  3. Best 150 Custom 404 error pages
  4. Download Wordpress Beta 0.9.0.134 for Blackberry
  5. Download Wordpress 2.8
  6. Mac Pro line updated, Promises 50% more performance.



{ 3 comments… read them below or add one }

JW July 18, 2009 at 3:35 pm

Is this actually a good idea? If I read that code correctly, it removes ‘%0a’ and ‘%0d’ from the location, which (after a quick Google search) seem to be the codes used in URLs for line feeds and carriage returns (\n and \r). The function in which you’re removing the line seems to sanitize URL’s for redirection, so after this change %0a’s and %0d’s won’t be removed correctly anymore.

It seems the function _deep_replace() is defined in the file wp-includes/formatting.php. Are you sure you have the correct version of that file?

Reply

Mansoor July 19, 2009 at 8:04 am

well, the error just mentioned that there is an error on pluggable.php on line 884 so formatting.php may be out of question…whatever we have to do is to do on pluggable.php on line 884…my aim was to make pluggable.php of 2.8.1 similar to pluggable.php of version 2.7 or 2.8 and when i checked old files they didnt contain this string…which i deleted… you are right on saying what the function performs but then this is workaround and not the solution…probably someone can come up with a more decent workaround or wordpress can bring a patch…this should also be noted that i experienced this error while installing it locally…

Reply

Hemi July 20, 2009 at 4:43 pm

i was having the same problem. i temporarily commented out the line just to get into the admin & then upgraded to 2.8.2 and the problem was gone.

Reply

Leave a Comment

Previous post:

Next post: