The scenario begins like any other troubleshooting scenario. You’ve just installed a plugin or theme on your WordPress blog, modified a file, or you’re simply checking on your blog. Suddenly, an error message just like the following looms over the page you’re viewing like a dark cloud.
Warning: Cannot modify header information - headers already sent by (output started at /path/blog/wp-config.php:34) in /path/blog/wp-login.php on line 42
Remember the first rule in troubleshooting, don’t panic! First, you need to interpret the error message. Offhand, it would seem as if line 42 of the wp-login.php file was the source of the problem, but that’s a common misconception. In fact, the problem is on line 34 of the wp-config.php file, and line 42 of the wp-login.php file is just the victim.
Now that you know where to look, what do you look for? Believe it or not, this problem is usually caused by nothing more than blank space (either a single blank space or an entire blank line) on the referenced line.
Now that you know where and what to look for, access your server via FTP or SFTP and use a plain text editor to edit the file. Alternatively, if you don’t want to mess with editing the file, replacing it with an original copy may resolve the issue.
What if you don’t see anything wrong with the file, and replacing the file didn’t resolve the issue? There’s always the possibility that a plugin or theme functions file could be causing the space to appear when the file is accessed. Try deactivating all plugins. If that resolves the issue, reactivate each one individually until you find the cause. If that does not resolve the issue, try switching to the Default theme (WordPress 1.5 – 2.9.2) or the Twenty Ten theme (WordPress 3.0 and higher) to rule-out a theme-specific issue. If you cannot access your admin panel, you’ll have to manually reset your plugins and theme, which we covered before in WordPress and the White Screen of Death.
If you still have not been able to resolve the issue, the volunteers in the WordPress Support Forums will be more than happy to help you. Just be sure to fill them in on all the steps you have taken thus far.