Warning: Cannot modify header information
Warning: Cannot modify header information
By Paul
Aug 09, 2004 (Edited Jan 30, 2014)
The "Cannot modify header information" warning means that there is output in the script before there's supposed to be. This could be for several reasons:
1) You have a error, warning or notice higher on the page.
Solution: Deal with the other error.
2) You're in debug mode.
Solution: Not applicable. You will always get these warnings in debug mode since for debug mode to be useful it has to output the debug info at the time of processing rather than waiting... the script might fail before getting past all the HTTP header output, for all it knows. Simply ignore these header information warnings, and be aware that cookies will not be getting set while you're debugging.
3) You've been editing a PHP file -- perhaps config.php or a /plugins/ or /modifications/ directory file.
Solution: You must have left a space in the file above the top <?php or below the bottom ?> in the file by accident. You need to ensure that there are no blank lines or spaces before the <?php or after the ?>. Delete the extraneous space and save/upload the file, and the warning message will be gone.
By Paul
Aug 09, 2004 (Edited Jan 30, 2014)
1) You have a error, warning or notice higher on the page.
Solution: Deal with the other error.
2) You're in debug mode.
Solution: Not applicable. You will always get these warnings in debug mode since for debug mode to be useful it has to output the debug info at the time of processing rather than waiting... the script might fail before getting past all the HTTP header output, for all it knows. Simply ignore these header information warnings, and be aware that cookies will not be getting set while you're debugging.
3) You've been editing a PHP file -- perhaps config.php or a /plugins/ or /modifications/ directory file.
Solution: You must have left a space in the file above the top <?php or below the bottom ?> in the file by accident. You need to ensure that there are no blank lines or spaces before the <?php or after the ?>. Delete the extraneous space and save/upload the file, and the warning message will be gone.
Description | Causes and solutions for this warning. |
Rating | |
Views | 1,460 views. Averaging 0 views per day. |