• Hi all,

    I’m getting the typical Headers warning problem:
    Warning: Cannot modify header information – headers already sent by (output started at…/public_html/wp-config.php:1) in …/wp-includes/pluggable.php on line 881)

    It is going worse each day becuase yesterday I could access my admin panel but I was getting that error when updating things and today I can’t access the admin panel.

    I have cleaned blank spaces on wp-config.php
    Later I have uploaded new fresh versions of wp-config.php and pluggable.php.
    Moreover, I have tryed deactivating plugins folders from FTP.

    And none of these solutions worked for me so i guess the problem is related with the wp_redirect() function. I read here that if I use javascript redirection I will probably solver the problem.

    Does anybody know how to do it?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Possibly an error/warning being output on /wp-includes/pluggable.php on line 881

    You can try and trap the output using this code

    <?php//you probably don't need to open PHP tags
    
    ob_start();//place this before line 881
    
    //line 881 content (or other suspect content)
    
    //then capture the output soon after the suspect content
    $error_out=ob_get_clean();
    
    //mail it to yourself to see what it says.
    mail('your@emailaddress.com','error output','-'.$error_out.'-');
    //If mail is empty look for white space between the dashes.
    
    //probably don't need to close either
    ?>

    This will possibly fix the issue as it traps the output an prevents it being output before the headers are sent. However mail it to yourself and see if it’s something you can fix. If it moves the error line number repeat until you see what the problem is.

    I should add it’s possible the buffer is already started so if you don’t get the email, comment out ob_start(); like this

    //ob_start();

    Thread Starter jaygm

    (@jaygm)

    Thanks for answering SyCo123,

    This is the Output that I got by email:


    <b>Warning</b>: Cannot modify header information – headers already sent by (output started at /home/xxx/domains/xxx.com/public_html/wp-config.php:1) in <b>/home/xxx/domains/xxx.com/public_html/wp-includes/pluggable.php</b> on line <b>881</b>

    So, basically I have the same info although the page to access admin panel now is empty and before I got the headers error. Any idea what else can I do?

    Thread Starter jaygm

    (@jaygm)

    So, does anybody know how to change wp_redirect()for javascript redirections?

    This error is fatal and killing hte script before you get to use javascript.

    You say you’ve cleaned the blank spaces but it’s possible you haven’t. I’ve seen weird bugs and sometimes it’s easiest to start again. Try making a new config file. Transfer the config info to the example, re-save as wp-config.php and FTP it to your WordPress folder.

    Oh I just read again and saw you’d done that. WEll you can try accessing the PHP files directly through the browser (eg http://www.yoursite.com/wp-config.php) and seeing if one is giving the error.

    Also use the ob_start code to trap anything in the wp-config file.

    Thread Starter jaygm

    (@jaygm)

    I have done that and I keep getting the same problem. I have also reinstalled the whole wordpress package (except wp-content) and I included my data in the new wp-config-sample.php and rename it. Nothing works. Always having the same headers warning.

    I don’t understand what is happening because I have reinstalled wordpress and my plugins are deactivated.

    Thread Starter jaygm

    (@jaygm)

    Ok. I found the solution. As usual, it was wp-config.php file. The thing is that believe it or not I checked for blank spaces in that file many times as well as upload and rename three times a wp-config-sample.php from new versions of WordPress that I download from this website.

    I finally decided to get a wp-config.php that I had in other website changing DB, USER and PSW and now it works.

    I don’t know I think this is strange…

    Thanks for your patience SyCo123

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

The topic ‘Headers already sent warning problem’ is closed to new replies.