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.

This entry was posted in wordpress and tagged , , , . Bookmark the permalink.

6 Responses to Call to undefined function: wp()

  1. Rudi says:

    thx man it help me a lot

  2. Luke says:

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

  3. Trumiro says:

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

  4. josep says:

    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

  5. BeyazTavsan says:

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

  6. andy says:

    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 Reply

Your email address will not be published. Required fields are marked *

*

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