Yesterday I was helping a reader solving his WordPress error, so I thought I might as well write an entry, just in case we all encounter this in the future. If you ever run across this error (or warning) in your WordPress with the message saying:
Warning: Cannot modify header information - headers already sent by (output started at //home/htdocs/wordpress/wp-config.php:1) in /home/htdocs/wordpress/wp-login.php on line 12
or something similar, chances are you have messed up your wp-config.php leaving some unnecessary spaces inside.
- Download your wp-config.php down via FTP (Edit directly if you have SSH access)
- Open wp-config with your favourite editor, and remove all spaces before "<?php" and after "?>"
- Upload and replace.
You are adviced to make backup of any files you edited.