Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    New Coder
    Join Date
    Sep 2012
    Posts
    23
    Thanks
    2
    Thanked 1 Time in 1 Post

    Warning: Cannot modify header information - headers already sent by - quesiton

    Hey guys,

    I got this error on my site today and haven't the faintest idea whats going on.

    Ive done my googling and have found 2 common occurences :

    1) wpconfig - extra spaces
    2) closing php tag ?>

    I haven't done much work at all with php and although with this site, i did manually edit the wpconfig file - it was done well over 6 months ago. This error has only just started and Im not entirely sure what to do and why this would be coming up now.
    I scanned the site for malware using this tool : Sucuri SiteCheck - Free Website Malware Scanner and its saying my site is infected - yet I feel like its producing that just because the site isnt loading properly. Just in case it is infected, I'm not sharing a link although screen capped : imgur: the simple image sharer

    So - to my question - what the heck should I do and where should I start?

    Any input and advice is appreciated.

    -

    So it turns out Im a noob and this is a really common problem. Ive continued my googling and Ive edited the following php files in attempt to fix my problem - with no luck.
    files edited:
    index.php in theme file
    index.php in theme/admin
    wpconfig.php
    pluggables.php

    Not sure where else to look as these are the ones references all over the place & the two files references by my site. :s
    Last edited by Stuck; 04-22-2014 at 04:04 AM.

  • #2
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,500
    Thanks
    8
    Thanked 1,089 Times in 1,080 Posts
    Have you had your site for a while, or are you just starting?

    If your site is new, and you've not done anything to it, I would wipe it all out and start over with a new WordPress Install.

    If you've done any customizing of your theme, you can make a safe copy of that directory so you can restore it after the new install.

    With WordPress, you should not edit, modify, or touch any files other than the ones in your theme directory.

  • #3
    New Coder
    Join Date
    Apr 2014
    Posts
    17
    Thanks
    0
    Thanked 1 Time in 1 Post
    Hi Stuck,

    Usually with this error it tells you which file contains the space(s) (usually something like 'output started at <some path and file name>'). Does it tell you a file?

    You may have multiple files that contain spaces but only one file name will show up in the browser.

    When the web server executes your web page PHP, the first occurrence of the space will be the one listed in the browser.

    PHP code executes from the top of the file to the bottom so any code (or files containing code included) after an error found won't be executed because an error causes the script to halt. Consequently any further space errors won't show up until you fix the initial error.

    Conclusion

    To fix your problems, you need to:-

    1) Check the file listed in the browser error for spaces and remove any found.
    2) Reload the page and repeat step one if a new error is found.

    Hopefully by systematically fixing each file that shows up as an error you will eventually rid yourself of problems.

  • #4
    New Coder
    Join Date
    Apr 2014
    Posts
    17
    Thanks
    0
    Thanked 1 Time in 1 Post
    Lol sorry beat me too mlseim. Must of been typing my post the same time as you.

  • #5
    New Coder
    Join Date
    Apr 2014
    Posts
    17
    Thanks
    0
    Thanked 1 Time in 1 Post
    Meant to say you beat me to it. Is their a way to edit posts? I can't seem to find a way to do it.

  • #6
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,500
    Thanks
    8
    Thanked 1,089 Times in 1,080 Posts
    Look at the gray bar beneath your post. Edit link left of the reply link.

  • #7
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,329
    Thanks
    60
    Thanked 526 Times in 513 Posts
    Blog Entries
    4
    I don't think new members can't edit their posts mlseim - it's to stop spammers signing up, posting and then later changing their posts to spam.

    At least thats how I understand it anyway.
    See my new CodingForums Blog: http://www.codingforums.com/blogs/tangoforce/

    Many useful explanations and tips including: Cannot modify headers - already sent, The IE if (isset($_POST['submit'])) bug explained, unexpected T_CONSTANT_ENCAPSED_STRING, debugging tips and much more!

  • #8
    New Coder
    Join Date
    Apr 2014
    Posts
    17
    Thanks
    0
    Thanked 1 Time in 1 Post
    Ahh ok, yeah I don't seem to have anything left of the reply. Thanks for the info guys.

  • #9
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,329
    Thanks
    60
    Thanked 526 Times in 513 Posts
    Blog Entries
    4
    Stuck this topic may be useful to you - I wrote an indepth topic about the headers already sent problem and how to fix it:

    TIP: Warning: Cannot modify header information - headers already sent
    See my new CodingForums Blog: http://www.codingforums.com/blogs/tangoforce/

    Many useful explanations and tips including: Cannot modify headers - already sent, The IE if (isset($_POST['submit'])) bug explained, unexpected T_CONSTANT_ENCAPSED_STRING, debugging tips and much more!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •