Support » Fixing WordPress » "Cannot modify header information – headers already sent" …

  • Resolved wafflepunk

    (@wafflepunk)


    Greetings!

    I have a small WordPress install that I tried to change the Site Address (URL) from http://www.MySite.com/Wordpress to http://www.MySite.com, but didn’t get a change in redirection behavior (www.MySite.com still just delivered a placeholder image instead of pointing to the WordPress install). So, foolishly I also changed the WordPress Address (URL) variable to http://www.MySite.com and was promptly locked out of functionality.

    I then edited functions.php using

    update_option('siteurl','http://your.site.url:port/blog');
    update_option('home','http://your.site.url:port/blog');

    to get access back to my site, which worked, and then removed those lines from the file and saved it on the server.

    I refreshed the page, everything seemed to be working fine, so I went to bed. Now this morning, I’m getting the following error message:

    Warning: Cannot modify header information - headers already sent by (output started at /home/UserName/www/www/wordpress/wp-content/themes/ThemeName/functions.php:1) in /home/UserName/www/www/wordpress/wp-content/plugins/woocommerce/classes/class-wc-session-handler.php on line 63

    I have insured that there is no whitespace at either the beginning or end of functions.php. I even rolled back the functions.php file to a version from 24hrs prior to making the edits via my host’s cPanel, with no effect.

    Can someone please point me in the right direction?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter wafflepunk

    (@wafflepunk)

    Also, deactivating the plugin mentioned in the error (WooCommerce) does get rid of the error message, but that doesn’t really help me…

    Plus, I had made absolutely zero changes other than the ones mentioned above, so not sure how the plugin install would have been affected?

    Thread Starter wafflepunk

    (@wafflepunk)

    Anyone got any ideas on this one?

    check the white spaces in this file also “class-wc-session-handler.php”

    Thread Starter wafflepunk

    (@wafflepunk)

    I’ve gone through that with no luck, yes. I have already verified that both files mentioned in the error message (functions.php and class-wc-session-handler.php) have absolutely no leading or trailing whitespace and are both opened and closed properly.

    Also, although my site currently works (with the header warning at the top) by navigating to http://www.MySite.com, I can NOT access the admin via http://www.MySite.com/wp-admin, I get a blank page with the headers warning message again.

    I am having the same exact issue!

    The first message is: Warning: is_readable() [function.is-readable]: open_basedir restriction in effect. File(C:\inetpub\vhosts\morristownrunning.com\httpdocs/wp-content/plugins/C:\inetpub\vhosts\morristownrunning.com\httpdocs\wp-content\plugins\nextgen-gallery\lang/nggallery-en_US.mo) is not within the allowed path(s): (C:/inetpub/vhosts/morristownrunning.com\;C:\Windows\Temp\) in C:\inetpub\vhosts\morristownrunning.com\httpdocs\wp-includes\l10n.php on line 339

    And then followed by several of these: Warning: Cannot modify header information – headers already sent by (output started at C:\inetpub\vhosts\morristownrunning.com\httpdocs\wp-includes\l10n.php:339) in C:\inetpub\vhosts\morristownrunning.com\httpdocs\wp-includes\pluggable.php on line 695

    I am not able to log in either and the error message is a the top of my page: http://www.morristownrunning.com

    I hope we can resolve this soon!

    Thread Starter wafflepunk

    (@wafflepunk)

    SOLUTION: After many, many hours of frustration I discovered that although there didn’t appear to be any whitespace when viewing/editing the functions.php file within my FTP program (FileZilla), viewing/editing the same file in a web browser via my service provider’s cPanel tools showed a hidden character at the very beginning of the file, preceding the opening <?php tag.

    This character was completely unrecognized by and invisible to FileZilla’s editor for some reason and did not register at all. Deleting the character and saving the file fixed all of my problems.

    Moral of the story: when an error handler tells you that the problem is occurring on line XX, that’s where the problem is, even if it doesn’t appear to be. It took me quite a while and a lot of headache to discover that in fact, yes, line 1 had an issue.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘"Cannot modify header information – headers already sent" …’ is closed to new replies.