Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress

ERROR - Launching a WordPress Site

I was following tutorail

  • Launching a WordPress Site -> How to Migrate a Local WordPress Site to Live Server

... so at 08:35 where you try to log in.. .. i enter my url....http://kristjan.eu/wp-admin/ And get error like : (nothing is displayed except this error )

Warning: Cannot modify header information - headers already sent by (output started at /data05/virt37173/domeenid/www.kristjan.eu/htdocs/wp-content/themes/kristjan/functions.php:1) in /data05/virt37173/domeenid/www.kristjan.eu/htdocs/wp-includes/pluggable.php on line 876

ANY idea how to solve it ?

OK found a "solution".. i replaced functions.php in my theme folder... with a a random functions.php file from another site... everything seems to work...

Googled the problem... it happens often...

Narrowing down the problem reasons... Update-ing post when found the root of evil :D

OK that was interesting.... Everything was ok... Seems like file was corrupted or so...

I took similar functions.php file and inserted block by block the site code... Everything worked... :D .. i had text editor open, filezilla open... etc.... maybe it some program made some changes with file....

CASE CLOSED, PROBLEM TERMINATED :P

3 Answers

Zac Gordon
STAFF
Zac Gordon
Treehouse Guest Teacher

Yes, extra white space or lines at the top of the functions.php file will cause header issues. Were you able to get your own code back into the functions.php file?

If it happens again, look for extra spaces or blank lines or anything else before an opening php tag or after a closing php tag.

See: http://codex.wordpress.org/FAQ_Troubleshooting#How_do_I_solve_the_Headers_already_sent_warning_problem.3F

It was not even empty space. Did triple check.. File file got currupted ...
Enyway .. PROBLEM SOLVED :)