這是因為 UTF-8 編碼檔的 header 中多了 BOM (Byte Order Mark) 識別碼,而這 BOM 常會讓 Apache 誤判,而發生 header already sent 的錯誤
建議用 ConvertZ 來把檔案轉換成 UTF-8,注意,請在 ConvertZ 的設定中找到 "加 BOM 到 UTF8 檔案"
[不要勾]
ConvertZ 可由其官方網頁下載到
http://alf-li.pcdiscuss.com/c_convertz.html
或是用 UltraEdit 這編輯器,設定 "將Write UTF-8 BOM header to ALL UTF-8 files
when saved 設成OFF",就不會在儲存時又在檔案中加入 BOM 了
Editplus 這編輯器也有可以設定 EditPlus > Tools > Preferences > Files > Support UTF-8 files without Byte Order Mark(BOM)
[勾起來]