WordPress.org

Forums

[resolved] Cannot modify header information, wp-config.php:1 has no blanks (12 posts)

  1. vitalichka
    Member
    Posted 5 years ago #

    Hello, and thank you all in advance for reading and maybe helping me with this. My site is on http://westminstercollegeblog.com and I have been having major problems as of this afternoon with it. This is the same error I tend to see once in a while on new installs abut can't seem to figure out how to repair.

    When I come to
    at the top of the page there are two errors.
    "Warning: Cannot modify header information - headers already sent by (output started at /home/westmins/public_html/wp-config.php:1) in /home/westmins/public_html/wp-login.php on line 302

    Warning: Cannot modify header information - headers already sent by (output started at /home/westmins/public_html/wp-config.php:1) in /home/westmins/public_html/wp-login.php on line 314"

    When I log in, it gives me this

    Warning: Cannot modify header information - headers already sent by (output started at /home/westmins/public_html/wp-config.php:1) in /home/westmins/public_html/wp-login.php on line 302
    
    Warning: Cannot modify header information - headers already sent by (output started at /home/westmins/public_html/wp-config.php:1) in /home/westmins/public_html/wp-login.php on line 314
    
    Warning: Cannot modify header information - headers already sent by (output started at /home/westmins/public_html/wp-config.php:1) in /home/westmins/public_html/wp-includes/pluggable.php on line 665
    
    Warning: Cannot modify header information - headers already sent by (output started at /home/westmins/public_html/wp-config.php:1) in /home/westmins/public_html/wp-includes/pluggable.php on line 666
    
    Warning: Cannot modify header information - headers already sent by (output started at /home/westmins/public_html/wp-config.php:1) in /home/westmins/public_html/wp-includes/pluggable.php on line 667
    
    Warning: Cannot modify header information - headers already sent by (output started at /home/westmins/public_html/wp-config.php:1) in /home/westmins/public_html/wp-includes/pluggable.php on line 868

    Now, understand that there are no blank lines or any garbage on the first line, and there is a closing ?> line as well with no excesses and I can't seem to figure out what the problem is.

    I know this is annoying being that this is one of the most frequently asked questions, but believe me I search nearly everything and have referred to the codex, and threads.

    Here's the code for wp-config, please advise.

    <?php
    /**
     * The base configurations of the WordPress.
     *
     * This file has the following configurations: MySQL settings, Table Prefix,
     * Secret Keys, WordPress Language, and ABSPATH. You can find more information by
     * visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing
     * wp-config.php} Codex page. You can get the MySQL settings from your web host.
     *
     * This file is used by the wp-config.php creation script during the
     * installation. You don't have to use the web site, you can just copy this file
     * to "wp-config.php" and fill in the values.
     *
     * @package WordPress
     */
    
    // ** MySQL settings - You can get this info from your web host ** //
    /** The name of the database for WordPress */
    define('DB_NAME', '********');
    
    /** MySQL database username */
    define('DB_USER', '********');
    
    /** MySQL database password */
    define('DB_PASSWORD', '********');
    
    /** MySQL hostname */
    define('DB_HOST', 'localhost');
    
    /** Database Charset to use in creating database tables. */
    define('DB_CHARSET', 'utf8');
    
    /** The Database Collate type. Don't change this if in doubt. */
    define('DB_COLLATE', '');
    
    /**#@+
     * Authentication Unique Keys.
     *
     * Change these to different unique phrases!
     * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/ WordPress.org secret-key service}
     * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
     *
     * @since 2.6.0
     */
    define('AUTH_KEY', '**********************************************************');
    define('SECURE_AUTH_KEY', '**********************************************************');
    define('LOGGED_IN_KEY', '**********************************************************');
    define('NONCE_KEY', '**********************************************************');
    /**#@-*/
    
    /**
     * WordPress Database Table prefix.
     *
     * You can have multiple installations in one database if you give each a unique
     * prefix. Only numbers, letters, and underscores please!
     */
    $table_prefix  = 'wp_';
    
    /**
     * WordPress Localized Language, defaults to English.
     *
     * Change this to localize WordPress.  A corresponding MO file for the chosen
     * language must be installed to wp-content/languages. For example, install
     * de.mo to wp-content/languages and set WPLANG to 'de' to enable German
     * language support.
     */
    define ('WPLANG', '');
    
    /* 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');
    
    define('WP_CACHE', true);
    ?>

    Thanks again, I hope this helps you see whatever I may not be seeing. I have done a lot including comparing and reverting to config/sample file. So far nothing, I am wondering if maybe this is happening because of a recent DB backup?

    Anyway, you're the pros. Thanks again.

  2. vpsdiscussions
    Member
    Posted 5 years ago #

    Please check in wp-login.php file and see if there are no malicious codes inserted. It may be possible that your blog hacked by someone.

  3. vitalichka
    Member
    Posted 5 years ago #

    Looks good, nothing out of the ordinary.
    What else could it be?

  4. WPpremium
    Member
    Posted 5 years ago #

    If you have not modified any default WordPress files, download the wordpress version which you have installed and make the necessary changes in your wp-config.php file. Now, upload all files in your domain's space and see if it helps.

    Also, your blog is working fine at my end. Clear your cache/cookies and then try to access it from your end.

  5. vitalichka
    Member
    Posted 5 years ago #

    Thanks for your responses. I'm sure files have been changed being that I have a few plugins running but its interesting because I have an identical site on wmcbba.freehostia.com identical site and it works fine. Also my site worked fine yesterday and not this morning, I'm wondering if could have been the db backup I did last night. Also its not the cookies or cache I have tried clearing them and still the same. I have printed out the stock files and my files and all looks well. Its interesting being that I always have these peoblems with wp but tend to fix it somehow and its never been the "blank spaces", etc.
    Anything else u think? Does the code above look good? I noticed there was no end tags at the end. I added them but made no difference also the sample file doesn't include end tags either.
    Please help.

  6. vitalichka
    Member
    Posted 5 years ago #

    Also forgot to mention that the front end does work fine it the back end I can't get into. Try loging in or registering.

  7. esmi
    Forum Moderator
    Posted 5 years ago #

    Try resetting the plugins folder by FTP or phpMyAdmin

  8. vitalichka
    Member
    Posted 5 years ago #

    How would you do this and wouldn't they need to be deactivated?
    Thank you, were getting somewhere.

  9. vitalichka
    Member
    Posted 5 years ago #

    Oops sorry about that you provided a link. So sorry. I am at work and am using a phone to access.

  10. vitalichka
    Member
    Posted 5 years ago #

    Ok so I reset the plugins folder via FTP and this changed nothing. Don't know where to go with this now. Anything else you think it could be?

  11. vitalichka
    Member
    Posted 5 years ago #

    I think I figured it out. I got home and loaded a backed up copy of wp-config.php I had saved yesterday. The only difference between the two was that there was a mention of wp-cache.

    /** Sets up WordPress vars and included files. */
    require_once(ABSPATH . 'wp-settings.php');
    
    define('WP_CACHE', true);
    ?>

    where as the original copy that works and is currently on the site looks like this.

    /** Sets up WordPress vars and included files. */
    require_once(ABSPATH . 'wp-settings.php');

    Hope this helps. Once I logged it, I could see that WP Super Cache was deactivated but it seems like there was still code referring to it in the file and being that this was the only difference, must have been the culprit.

    Even renaming the plugins folder to plugins.hold and creating a new and empty one didn't do anything.

    Thanks for all of your input and help. I hope this helps someone else now who may be encountering similar problems. There were not blank lines or spaces or anything like that although this can be the problem sometimes, as I have seen and experienced myself many times before.

    Thanks again.

  12. coffee3k
    Member
    Posted 5 years ago #

    Yes! WP Super Cache was the problem. Thanks.
    I also have this line, once I quote it out everything went back to normal.
    define('WP_CACHE', true); //Added by WP-Cache Manager
    Thank you vitalichka.
    Cheers!

Topic Closed

This topic has been closed to new replies.

About this Topic