WordPress Error : Warning cannot modify header information

If you ever encounter following error in your WordPress site:

Warning: Cannot modify header information – headers already sent by (output started at //home/htdocs/wordpress/wp-config.php:1) in….

then you must have left unnecessary spaces in your wp-config.php file.

Solution:

Edit the wp-config.php file and make sure there are no spaces before “<?php” and after “?>”