WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] [closed] Fatal error: Call to undefined function wp() in /wp-blog-header.php on line 14 (15 posts)

  1. rudraraju
    Member
    Posted 1 year ago #

    I am running WordPress Multisite at http://raju.com.au/. It has a subdomain install. I am then using wordpress-mu-domain-mapping plugin to map http://mandolinsiters.com for example to http://mandolinsisters.raju.com.au

    Everything was going fine until I tried to install Akismet and had added the code define('WPCOM_API_KEY' , 'API_KEY_HERE'); to wp-config.php when I started to receive the following error when i visit http://raju.com.au

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

    and when i visit http://raju.com.au/wp-admin/ I receive the following error

    Fatal error: Call to undefined function nocache_headers() in /home/raju/public_html/wp-admin/admin.php on line 32

    I tried everything recomended in the forums including deleting plugins (Akismet and WP Super cache); re-installing all contents of WordPress (except wp-contents folder).

    The database still seems to have everything I need. This is my wp-config.php file code. Any help/suggestions in getting this back is much appreciated.

    <?php
    /**
     * The base configurations of the WordPress.
     * @package WordPress
     */
    
    // ** MySQL settings - from my web host ** //
    
    define('DB_NAME', 'databasename');
    define('DB_USER', 'username');
    define('DB_PASSWORD', 'password');
    define('DB_HOST', 'localhost');
    define('DB_CHARSET', 'utf8');
    define('DB_COLLATE', '');
    
    /**#@+
     * Authentication Unique Keys and Salts.
     */
    
    $table_prefix  = 'wp_';
    define('WPLANG', '');
    define('WP_DEBUG', false);
    define('WP_ALLOW_MULTISITE', true);
    define('SUNRISE', 'on');
    /* That's all, stop editing! Happy blogging. */
  2. Turn off sunrise for a test?

  3. rudraraju
    Member
    Posted 1 year ago #

    Hi Ipstenu,
    Thanks for your suggestion. I tried to set define('SUNRISE', 'off');; still getting same error.
    However, when i added this code from sample file to wp-config.php I got error "Error establishing a database connection". My WP installation is at the site root.

    /** Absolute path to the WordPress directory. */
    if ( !defined('ABSPATH') )
    	define('ABSPATH', dirname(__FILE__) . '/');
    
    /** Sets up WordPress vars and included files. */
    require_once(ABSPATH . 'wp-settings.php');
  4. Wait, that was your WHOLE wp-config?

    Uh, something isn't right then, becuase it should look like the sample.

    Rebuild the wp-config from scratch.

  5. rudraraju
    Member
    Posted 1 year ago #

    Thanks Thanks Thanks!!!!!! a lot Ipstenu, I got the sites back. You rock!

    However, I have a minor issue. I had saved the uploads blogs.dir folder containing hundreds of images. After reinstalling WP I copy/pasted the blogs.dir folder. Now the images don't display on he site and in the WP media uploader (even though I can see them via FTP).

    For example, on the subdomain homepage http://mandolinsisters.raju.com.au/ I notice that the image on the right http://mandolinsisters.raju.com.au/files/2012/12/Sreeusha-Sireesha1.jpg does not load up. When I look at the same image via FTP I can see the image http://ftp.raju.com.au/www/wp-content/blogs.dir/9/files/2012/12/Sreeusha-Sireesha1.jpg

    Is there an easy way to fix this image issue?

    I could manually upload and relink all the images again; though that will be a pain and duplicate the images on server.

  6. What's in your .htaccess?

  7. rudraraju
    Member
    Posted 1 year ago #

    Sorry for the delay Ipstenu.

    here is the complete .htaccess file code

    # BEGIN WPSuperCache
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    #If you serve pages from behind a proxy you may want to change 'RewriteCond %{HTTPS} on' to something more sensible
    AddDefaultCharset UTF-8
    RewriteCond %{REQUEST_URI} !^.*[^/]$
    RewriteCond %{REQUEST_URI} !^.*//.*$
    RewriteCond %{REQUEST_METHOD} !POST
    RewriteCond %{QUERY_STRING} !.*=.*
    RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$
    RewriteCond %{HTTP:X-Wap-Profile} !^[a-z0-9\"]+ [NC]
    RewriteCond %{HTTP:Profile} !^[a-z0-9\"]+ [NC]
    RewriteCond %{HTTP:Accept-Encoding} gzip
    RewriteCond %{HTTPS} on
    RewriteCond %{DOCUMENT_ROOT}/home/raju/public_html/wp-content/cache/supercache/%{SERVER_NAME}//$1/index-https.html.gz -f
    RewriteRule ^(.*) "/home/raju/public_html/wp-content/cache/supercache/%{SERVER_NAME}//$1/index-https.html.gz" [L]
    
    RewriteCond %{REQUEST_URI} !^.*[^/]$
    RewriteCond %{REQUEST_URI} !^.*//.*$
    RewriteCond %{REQUEST_METHOD} !POST
    RewriteCond %{QUERY_STRING} !.*=.*
    RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$
    RewriteCond %{HTTP:X-Wap-Profile} !^[a-z0-9\"]+ [NC]
    RewriteCond %{HTTP:Profile} !^[a-z0-9\"]+ [NC]
    RewriteCond %{HTTP:Accept-Encoding} gzip
    RewriteCond %{HTTPS} !on
    RewriteCond %{DOCUMENT_ROOT}/home/raju/public_html/wp-content/cache/supercache/%{SERVER_NAME}//$1/index.html.gz -f
    RewriteRule ^(.*) "/home/raju/public_html/wp-content/cache/supercache/%{SERVER_NAME}//$1/index.html.gz" [L]
    
    RewriteCond %{REQUEST_URI} !^.*[^/]$
    RewriteCond %{REQUEST_URI} !^.*//.*$
    RewriteCond %{REQUEST_METHOD} !POST
    RewriteCond %{QUERY_STRING} !.*=.*
    RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$
    RewriteCond %{HTTP:X-Wap-Profile} !^[a-z0-9\"]+ [NC]
    RewriteCond %{HTTP:Profile} !^[a-z0-9\"]+ [NC]
    RewriteCond %{HTTPS} on
    RewriteCond %{DOCUMENT_ROOT}/home/raju/public_html/wp-content/cache/supercache/%{SERVER_NAME}//$1/index-https.html -f
    RewriteRule ^(.*) "/home/raju/public_html/wp-content/cache/supercache/%{SERVER_NAME}//$1/index-https.html" [L]
    
    RewriteCond %{REQUEST_URI} !^.*[^/]$
    RewriteCond %{REQUEST_URI} !^.*//.*$
    RewriteCond %{REQUEST_METHOD} !POST
    RewriteCond %{QUERY_STRING} !.*=.*
    RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$
    RewriteCond %{HTTP:X-Wap-Profile} !^[a-z0-9\"]+ [NC]
    RewriteCond %{HTTP:Profile} !^[a-z0-9\"]+ [NC]
    RewriteCond %{HTTPS} !on
    RewriteCond %{DOCUMENT_ROOT}/home/raju/public_html/wp-content/cache/supercache/%{SERVER_NAME}//$1/index.html -f
    RewriteRule ^(.*) "/home/raju/public_html/wp-content/cache/supercache/%{SERVER_NAME}//$1/index.html" [L]
    </IfModule>
    
    # END WPSuperCache
    
    # BEGIN WordPress
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]
    
    # END WordPress

    and here is my wp-config.php code in full (Salts removed)

    <?php
    define('WP_CACHE', true); //Added by WP-Cache Manager
    define( 'WPCACHEHOME', '/home/raju/public_html/wp-content/plugins/wp-super-cache/' ); //Added by WP-Cache Manager
    define('DB_NAME', 'my-db-name');
    define('DB_USER', 'my-db-user');
    define('DB_PASSWORD', 'my-db-pswd');
    define('DB_HOST', 'localhost');
    define('DB_CHARSET', 'utf8');
    define('DB_COLLATE', '');
    /* Authentication Unique Keys and Salts code from here has been removed.*/
    $table_prefix  = 'my-prefix_';
    define('WPLANG', '');
    define('WP_DEBUG', false);
    define('WP_ALLOW_MULTISITE', true);
    define('MULTISITE', true);
    define('SUBDOMAIN_INSTALL', true);
    define('DOMAIN_CURRENT_SITE', 'raju.com.au');
    define('PATH_CURRENT_SITE', '/');
    define('SITE_ID_CURRENT_SITE', 1);
    define('BLOG_ID_CURRENT_SITE', 1);
    define( 'SUNRISE', 'on' );
    /* That's all, stop editing! Happy blogging. */
    
    /** Absolute path to the WordPress directory. */
    if ( !defined('ABSPATH') )
    	define('ABSPATH', dirname(__FILE__) . '/');
    
    /** Sets up WordPress vars and included files. */
    require_once(ABSPATH . 'wp-settings.php');
  8. Turn of Super Cache.

    Make THIS your .htaccess:

    # BEGIN WordPress
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]
    
    # END WordPress
  9. rudraraju
    Member
    Posted 1 year ago #

    Got it! Thanks fo your help Ipstenu

    I used the code from http://perishablepress.com/htaccess-code-for-wordpress-multisite/comment-page-2/#comment-89363 to make it work

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # uploaded files
    RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule . index.php [L]
  10. rudraraju
    Member
    Posted 1 year ago #

    You have been very very helpful; all my sites are back to normal.

  11. hmmudassir
    Member
    Posted 11 months ago #

    I have a problem, I have edited my wp-config.php file by adding the code define('WP_MEMORY_LIMIT', '64M'); to increase the size but it generates an error:

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

    Please any help me,

  12. murarig
    Member
    Posted 8 months ago #

    Hi Support,

    My website broke and i am getting the below error. Please let me know what needs to be done?

    Before i got the error everything working fine, i have removed the Redirection Plugin and then i site is not logging into Admin or cannot able to browse anything.

    Error displaying when i hit my domain name on the browser ediscoverysquad.com

    "
    Fatal error: Call to undefined function wp() in /home/content/58/10772258/html/wp-blog-header.php on line 14"

  13. jarmerson
    Member
    Posted 7 months ago #

    I hope I'm not out of line and this isn't going to be helpful to the problem (which looks like you've resolved), murarig, but you're showing all the goods in your post...

    ediscoverysquad.com

    [Moderator note: Please don't repost the credentials]

    As well as all your keys...

    Hopefully someone PM you or you caught it and changed everything. If not, I highly suggest doing so...

    I stumbled onto this while researching my own problems :)

  14. murarig
    Member
    Posted 7 months ago #

    Hi is there anyway i can remove my post or contents of the post? If so please let me know the procedure to remove my post contents.

  15. jarmerson
    Member
    Posted 7 months ago #

    By default WordPress.org does not delete threads or comments, however you may take a look at the links below and decide where to go from there.

    Reporting Threads

    Deleting / Editing Posts

    Contacting the Moderators

    Murarig, these threads are public and indexed by search engines ie Google. Given that you have had this information up for ~3 weeks, I strongly suggest correcting the issue by changing your WordPress setup to ensure there are no vulnerabilities.

    Use a plugin ie http://wordpress.org/plugins/better-wp-security/ to improve security. This plugin has a few great features that would help ie changing the DB prefix.

    Again, as your info has been up for a while, please consider taking the time to setup new database, user, password, generate new keys and migrate your production site ASAP.

Topic Closed

This topic has been closed to new replies.

About this Topic