Jump to content

MAMP gives errors, Server works perfect


Go to solution Solved by unemployment,

Recommended Posts

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
Link to comment
https://forums.phpfreaks.com/topic/279314-mamp-gives-errors-server-works-perfect/
Share on other sites

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.