• Resolved therealcaffeine

    (@therealcaffeine)


    I’ve just uploaded a fresh wordpress installation to https://www.therealcaffeine.com/. When I load that page it gives me the following error:

    Fatal error: Call to undefined function: wp() in /home/content/t/h/e/thercaffeine/html/wp-blog-header.php on line 14

    I know my host’s database is working, and that it can run wordpress because it has before. The same installation (albeit with different database information) worked on my local server. I’ve checked the forums, and I do have a wp-includes directory, where all files are present (specifically functions.php) and none are size zero. All three directories (wp-content, wp-admin, and wp-includes) have permissions 755. Is that the correct permission? And what else can I check to get my blog running?

Viewing 15 replies - 1 through 15 (of 21 total)
  • Hi Kafkaesqui – sorry, but that’s not actually a helpful answer.

    There are many posts and replies there but I’m having exactly the same problem as therealcaffine since moving one of my WP sites to a new host and can’t find the answer. I’ve followed tambla’s tutorial for moving and restoring, done several of the most promising suggestions in a number of the posts you point to, and all with no avail. (Spent most of Christmas trying to fix this, now banging my head on the wall!)

    It would be helpful, I think, if someone could let me and therealcaffine know where the wp function being called should be located/generated. We may then be able to track down the solution?

    Thread Starter therealcaffeine

    (@therealcaffeine)

    Kafkaesqui: as you can see from my post, I did search the forum. Didn’t find anything of use though, which I thought I included in my post, but apparently not. Were there any particular posts you thought would be useful?

    sonja1234: where’s that tutorial? Could you provide a link please? The WP function is located in wp-includes/functions.php. I’ve checked the code and there seems to be nothing wrong with it (and again, it works on my local server.) What host are you using?

    Here’s the moving tutorial:

    https://www.tamba2.org.uk/wordpress/move/

    Pretty comprehensive.

    I used to be on eMaxhosting, but have just moved over to Clook.

    I had a look for a function called wp in wp-includes/functions.php but couldn’t find it, so assumed it must be somewhere else… I’ll try replacing the file with a fresh one from the WP download.

    Hmm… the old file was 64k, the new 73k, but replacing the file doesn’t seem to have made any difference.

    Have now found the wp function in the new file. It seems to call up something called $query_var Could this be where the problem is?

    Thread Starter therealcaffeine

    (@therealcaffeine)

    I can’t claim to know even the basics of database programming, but that seems to be something to do with the database. Besides, WordPress claims that the function wp() can’t be found, not that there’s something wrong inside the actual function. Just for kicks, I’m going to comment out that line and try again. Might help, but it’ll probably cripple the whole thing. Who knows, though?

    EDIT: errr… that is, comment out line 14 of wp-blog-header.php where wp() is called.

    Commenting out the line doesn’t help, does it? Just takes you to the next fuction it can’t find! I’m beginning to suspect its something to do with the MySQL database setup, but I know nothing about that either.

    I have to finish for the rest of the day now. Will check back tomorrow. Good luck!

    Thread Starter therealcaffeine

    (@therealcaffeine)

    Nope, didn’t help at all, as expected. This is a completely fresh install, I’ve removed my previous wordpress directory and the database (which I had backed up, don’t worry) and nothing’s still working. Everything worked in this folder before, and it’s rather odd that it doesn’t now…

    Back at it again! Thinking overnight, I’ve gone off the idea that its to do with the database: the error message indicates that the wp-config.php is being found, but the wp function isn’t being defined. As wp funtion is defined in wp-includes/functions.php, it seems there is a problem between these two files. But what? Any ideas anyone?

    This is where the problem seems to be – WP doesn’t seem to be reading the functions in functions.php. I set up one of my own, to output some text to the screen before calling wp() and wp-blog-header.php then stopped at that with the same error message.

    Help, please! Someone must know what’s happening when WP runs but doesn’t seem to pick up the functions defined in wp-includes/functions.php!

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    If the call to wp() doesn’t work, then your wp-config.php is broken somehow. Probably the end is cut off or you didn’t close a quote or something else. Whatever it is, you probably broke it.

    Download a fresh copy of wordpress and look at the wp-config-sample.php file. Compare it with your file. That require_once at the end? It’s important that you don’t change it or make it not work or what have you.

    Thanks, but I’m now a step further back ??

    I downloaded a new copy of WP, adapted the contents of the new wp-config-sample.php, renamed it to wp-config.php, ftp’d it over the one on th eserver, and now I’m getting the WP error:

    “Can’t select database

    We were able to connect to the database server (which means your username and password is okay) but not able to select the stevehar_wrdp1 database. etc.” In otherwords, it’s not now recognising ‘localhost’ (I didn’t touch that) as the host.

    Am I one of the 1% who does need to change that? If so, what too?

    Thread Starter therealcaffeine

    (@therealcaffeine)

    Ooh, I’ll try that soon’s I get home. Thank you so much, Otto42. I’ve again no clue about databases, but I wish I could help.

Viewing 15 replies - 1 through 15 (of 21 total)
  • The topic ‘call to undefined function wp()’ is closed to new replies.