• Resolved tedgoas

    (@tedgoas)


    I have a WP site running locally using MAMP. I’ve been working on the site for several weeks without issue on either the public or admin site. But tonight when I started up Firefox, the I was unable to log into the admin. I can see the public site at http://localhost:8888/, as well as the admin login page http://localhost:8888/wp-login.php. But I get a blank screen when I try logging in.

    My PHP error log shows:
    PHP Warning: Cannot modify header information - headers already sent by (output started at /Work/Emerald/www-wordpress/wp-content/themes/themename/functions.php:9) in /Work/themename/www-wordpress/wp-login.php on line 353

    /wp-includes/pluggable.php also shows an error in the php log. I checked these files, but I don’t really know what I’m looking at (and haven’t changed them since install).

    I’ve tried:

    Still getting the same errors. I have a handful of plugins, but the php errors didn’t coincide with activating one.

    What could have happened? What else can I try?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Have you checked for any extraneous white-space characters at the start or end of the file?

    An error being thrown in the functions.php could be another culprit.

    Comment out code (or newly added code) and see if the problem persists.

    Next thing would be to show some of the code that the errors refers to.

    yeah, showing us the first 10 lines of your functions.php should help. or drop the whole thing in a pastebin and report the link to your paste back here.
    http://pastebin.com

    Thread Starter tedgoas

    (@tedgoas)

    Thanks guys. I have checked for extraneous white-space in both wp-config.php and wp-login.php.

    I haven’t checked out functions.php, which I’ve added code to. I’ll experiment with that to see if it’s the culprit.

    having whitespace at the brginning of functions.php is always an issue. So is whitespace between functions sometimes.

    code code
    } ?>
    
    spaaaaaaace
    
    <?php function blah()

    since your error is kicking on line 9 of functions.php…. that would definitely be where I would look. There is really no reason to ever open and close php in functions.php, other than breking out into html…..

    Thread Starter tedgoas

    (@tedgoas)

    Many thanks Rev. Voodoo and Dreyer. The source of the error was extra space between two PHP functions. Exactly what’s in Rev. Voodoo’s example above. Removed the extra tags and space, now all seems fixed.

    Thanks again!

    Hey cool, I’m glad I was able to help!

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

The topic ‘Another "Cannot modify header information – headers already sent by"’ is closed to new replies.