Skip to:
Content
Pages
Categories
Search
Top
Bottom

Fatal error: Call to undefined function wp()

  • Hi,

    New WP install 2.7.1 at /.

    Working just fine.

    Downloaded bbpress and uploaded to /bbpress

    Went to /bbpress in my browser and went through the install screens.

    wp-config.php did not have a secret key, so generated one, inserted, and FTPd over.

    Completed the installation.

    But now I can’t see my wordpress at http://www.atcv.net, but get this error:

    Fatal error: Call to undefined function wp() in /home/philipsh/public_html/wp-blog-header.php on line 14

    Can’t access wp-admin either, get this error:

    Fatal error: Call to undefined function get_option() in /home/philipsh/public_html/wp-admin/admin.php on line 21

    Any and all help gratefully received.

Viewing 17 replies - 1 through 17 (of 17 total)

  • chrishajer
    Participant

    @chrishajer

    My guess is you have a config error in your bb-config.php. Loading this page:

    http://www.atcv.net/bbpress/

    Gets me this error:

    Parse error: syntax error, unexpected T_STRING in /home/philipsh/public_html/bbpress/bb-config.php on line 22

    Line 22 is around the database password. Maybe the previous line is not quoted properly or is missing the semi-colon. My guess is that you have an error in that file and if you fix that, things will probably be OK.

    If you have a text editor with syntax highlighting, it will be easy to find the PHP syntax error that is causing this.

    Opened a copy of bb-config.php in dreamweaver for its syntax highlighting capability as you suggested Chris, thanks. All the comments stuff preceded by // is in orange font until this line, number 18…

    define('BB_SECRET_KEY', 'i have changed this here so my secret key isn't made public'); // Change this to a unique phrase.

    The comment in this line of code and all subsequent lines are in red font. But the format of the definition looks good to me. How about you? My actual secret key, as generated by the WP API, has semi-colons FYI.

    Should have added that line 22 is…

    $bb_table_prefix = 'bb_'; // Only letters, numbers and underscores please!


    chrishajer
    Participant

    @chrishajer

    I think the problem is with the secret key from WordPress. There have been problems in the past with characters that are allowed by WordPress causing problems in bbPress. If you can change it in both places, I would do that.


    chrishajer
    Participant

    @chrishajer

    BTW, I was just looking at line 22 in bb-config.php in the trunk. You didn’t mention what version of bbPress you installed.

    Thanks Chris. My version of bbpress is the latest stable one at the time of writing: 0.9.0.4.

    Just changed the secret key in both bb-config.php and wp-config.php to a 37 character long string of letters only, and we have success at http://www.atcv.net/bbpress :-). Awesome. Thanks v much.

    But I get the following at my wordpress root http://www.atcv.net:

    Fatal error: Call to undefined function wp() in /home/philipsh/public_html/wp-blog-header.php on line 14

    so perhaps my integration with WordPress remains flawed?


    chrishajer
    Participant

    @chrishajer

    The latest stable bbPress (0.9.0.4) does not integrate nicely with WordPress 2.7.1.

    What does line 14 of wp-blog-header.php look like?

    Thanks again Chris for coming back on this thread. I am surprised to read your statement about integration though, as it was this feature of bbpress that made me go for it over other forums! Oh well, may be it’ll come out good in the end.

    Here’s the code for wp-blog-header.php. Line 14 simply says “wp();”.

    <?php

    /**

    * Loads the WordPress environment and template.

    *

    * @package WordPress

    */

    if ( !isset($wp_did_header) ) {

    $wp_did_header = true;

    require_once( dirname(__FILE__) . '/wp-load.php' );

    wp();

    require_once( ABSPATH . WPINC . '/template-loader.php' );

    }

    ?>


    chrishajer
    Participant

    @chrishajer

    That’s weird – I never saw that wp(); before. I have no idea what to say in this case.

    What happens if you undo the integration, including whatever you included in the bb-config or wp-config to make them talk to each other? Does the problem go away?

    Chris, you’ve asked me to “undo the integration”… can’t find instructions on how to do this so still trying to figure it out. Back as soon as. Cheers.


    chrishajer
    Participant

    @chrishajer

    Just remove any line you added to bb-config.php or wp-config.php that includes the other program. If you added a line to include bbPress in WordPress, or added a line to include WordPress in bbPress, in the config files, just comment them out and see if this still happens.

    I think I’m going to have delete my WordPress instance now and reinstall. :-(

    Thanks Chris for your help, but bbPress has really messed things up. I used the installation process to set the config files, so it’s not entirely clear what I need to do. I have cleaned up the wp-config.php file back to how I think it should have been, but still no go.

    I think changes may have been made to the db tables for which I’m not sufficiently skilled to reverse.

    So that’s that. Thanks again for you help though.


    chrishajer
    Participant

    @chrishajer

    Be sure to delete all the bb_ tables. The only WordPress tables that were modified by bbPress should be the wp_usermeta and wp_users tables. If you changed the table prefix for the bbPress installation, be sure you delete the correct tables.

    Also, it makes sense to backup the whole database before doing any of this, just in case.


    chrishajer
    Participant

    @chrishajer

    Also, bbPress does not modify the wp-config.php. Maybe you added a line there, but bbPress doesn’t touch that file.

    well what happened at :

    http://www.atcv.net/

    it is up and running!!!!!

    did you reinstalled wordpress? and bbPress??

    well i am facing similar problem i used wordpress 2.8.2 and bbpress 1.0.2,

    similar error:

    Fatal error: Call to undefined function wp() in /……./wp-blog-header.php on line 18

    it has shifted to line 18 because i did functions integration

    https://bbpress.org/documentation/integration-with-wordpress/

    earlier bbPress was running but not the wordpress, after doing this Functions integration bbPress too started showing a warning about this require_once(‘path/to/wp-blog-header.php’); and a fatal error.

    but then i removed the function require_once(‘path/to/wp-blog-header.php’); and now i have bbPress up and running, earlier there was a SECURE AUTH cookie salt mismatch which i changed, but i didn’t solve the problem with wordpress install, earlier while installing bbPress, i checked wordpress config file it had three cookie keys and salts weren’t there so i defined 70 letter long strings with the characters

    1,2,3…0

    a,b,c…z

    A,B,C…Z

    !@#$%^&*()_+=-:”‘;<>?/.,

    true wordpress keys don’t have these special characters

    could these be the cause of the problem?

    or filling in a wrong key at installtion process could have done it,

    i don’t think defining a new salt key could have initiated all this

    i have two wordpress MU installs and bbPress works well with them.

    why problems with standard wordpress maybe character support?????????

    resolved hadn’t had to delete my wordpress install but have to check whether the integration works or not :)

    well it is due to the keys character support may not be the problem but keys surely are because of

    1. wrong defining of salt key

    2. mismatch of keys

    had defined secure auth key salt longer than the secure auth key cookie and wordpress LOGGED IN salt was not matching the bbPress LOGGED IN salt cookie, this wasn’t the root but wrong definition might have been.

    advice:

    while filling up these keys be patient and double check them.

    i am currently facing Fatal error: Call to undefined function in almost every file virtually :)

    that i think is due to functions integration with wordpress

    this all is due to this little function:

    require_once(‘path/to/wp-blog-header.php’);

    https://bbpress.org/documentation/integration-with-wordpress/

    thanks for the help

Viewing 17 replies - 1 through 17 (of 17 total)
  • You must be logged in to reply to this topic.
Skip to toolbar