unemployment Posted June 18, 2013 Share Posted June 18, 2013 MAMP is giving me the following error:E_WARNING: Cannot modify header information - headers already sent by (output started at /Users/jason/Sites/site.com/admin.site.com/show.php:1) in /Users/jason/Sites/trekeffect.com/admin.site.com/assets/init.inc.php on line 8 Do you know why this would happen?This is line 8 in init.inc.php: header('Content-type: text/html; charset=UTF-8'); This is line 1 of show.php <?php Quote Link to comment https://forums.phpfreaks.com/topic/279314-mamp-gives-errors-server-works-perfect/ Share on other sites More sharing options...
mac_gyver Posted June 18, 2013 Share Posted June 18, 2013 your file is saved as a UTF-8 encoded file with the Byte Order Mark (BOM) characters saved at the front of the file or you have some characters in the file before the <?php tag AND either output buffering is turned on on the live server so that the characters don't matter OR you are FTP'ing the file using ascii mode and the BOM characters are stripped off. make sure you have no characters in the file before the <?php tag and if you need to save the file as a UTF-8 encoded file, you need to save it without the BOM characters (this is a setting in your editor) or if you don't need it to be saved as a UTF-8 encoded file, save it as an ascii encoded file. Quote Link to comment https://forums.phpfreaks.com/topic/279314-mamp-gives-errors-server-works-perfect/#findComment-1436637 Share on other sites More sharing options...
Solution unemployment Posted June 18, 2013 Author Solution Share Posted June 18, 2013 Thank you. Turning on output buffering solved the issue. Quote Link to comment https://forums.phpfreaks.com/topic/279314-mamp-gives-errors-server-works-perfect/#findComment-1436648 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.