WordPress: Warning: Cannot modify header information
when you change your Provider or your provider changes PHP version the Login page of WordPress (wp-login.php) shows an error message like this and a login is impossible:
Warning: Cannot modify header information headers already sent by…
This error could occur when
- A file has a encoding format which PHP cannot interpret correctly. For example UTF-8 with BOM
- Whitespaces, Carriagereturns or “invalid” characters before “<?php” tags
- Whitespaces or Carriagereturns after “?>” tags
For troubleshooting this issue activate temporary debugging in the wp-config.php by setting
Open the Login page. Some debug lines should appear at the top of the page which points to the file and the line which raises the error. In this example the QuickAdsense Plugin. Line 1 indicates that the file encoding is wrong, a line number higher then 1 indicates invalid characters. In the example both occurs.
The error is located at line 1009. Open the file. I recommend notepad++, a very good editor. Go to the line
In this example some carriage returns causes the error. Remove them and convert the file to ANSI encoding. This should always work.
This should fix the problem.