July 17, 2008

Call to undefined function: wp()

I came across a frustrating bug today that has a pretty simple solution. I had an installation of WordPress that had been created by Fantastico. I needed to modify wp-config.php, but once I saved it back to the server WordPress just refused to start. It returned the following error:

Call to undefined function: wp() in wp-blog-header.php

Anyway, I tried a number of different things to resolve the issue and almost ended up tearing my hair out, but in the end I managed to resolve it. Turns out that the line endings in the wp-config.php file created by Fanstastico aren’t standard CR/LFs. When I opened the file up in Notepad2, my text editor of choice, they appeared to me “Mac-type” line terminations. Setting these to normal CR/LFs and deleting any extra lines at the end of the file resolved the issue.

6 Readers Commented »

  1. thx man it help me a lot

  2. Thank you. You just saved my day (apart from preventing me from getting bald). Latte treated ;)

  3. Thanks! I had the same problem.
    Tried to correct with Notepad2 as you said and now it works!
    Damn Fantastico!

  4. josep on March 11th, 2009

    4

  5. hi

    i have the same problem

    i don´t have notepad2, i use dreamweaver on a mac os x

    do u think I can do something. I´m getting crazy to install wordpress on my webserver

    cheers mate

  6. Just saved me from banging my head on the table! Thank you.

  7. This is what I see on my wp-config.php

    Does that make sense? Do I need all of this?
    My blog is here: http://newsletter.michelebarattablog.com/

    Help? Anyone?

Leave a Comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

wordpressguru.eu © 2010. All Rights Reserved. Powered by WordPress. SuperPress Theme