我管理兩個不同的博客。他們都是WordPress的2.8.6(所以他們有完全相同的源代碼,插件除外),但他們位於兩個不同的託管平臺(hostmonster.com和aruba.it)。 爲了解釋我的問題,我已經把SmartSniff與每個站點的會話都拋棄了。由Wordpress自動生成的PHP頁面中的BOM
這裏是HostMonster的轉儲:
GET /blog/paolo/ HTTP/1.1
Host: www.e-venturi.com
Accept-Encoding: identity
Accept-Language: en-us
Accept: text/html, text/plain, text/xml, image/gif, image/x-xbitmap, image/x-icon,image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, */*
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0;)
HTTP/1.1 200 OK
Date: Sat, 28 Nov 2009 23:47:38 GMT
Server: Apache/2.2.14 (Unix) mod_ssl/2.2.14 OpenSSL/0.9.8l DAV/2 mod_auth_passthrough/2.1 FrontPage/5.0.2.2635
X-Powered-By: PHP/5.2.11
X-Pingback: http://www.e-venturi.com/blog/paolo/xmlrpc.php
Vary: Accept-Encoding
Transfer-Encoding: chunked
Content-Type: text/html; charset=UTF-8
a6
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
阿魯巴
現在:
GET /blog/ HTTP/1.1
Host: www.cubanite.net
Accept-Encoding: identity
Accept-Language: en-us
Accept: text/html, text/plain, text/xml, image/gif, image/x-xbitmap, image/x-icon,image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, */*
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0;)
HTTP/1.1 200 OK
Date: Sat, 28 Nov 2009 23:49:19 GMT
Server: Apache/2.2
X-Pingback: http://www.cubanite.net/blog/xmlrpc.php
Vary: Accept-Encoding
Transfer-Encoding: chunked
Content-Type: text/html; charset=UTF-8
100b
...<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
(注:A6和100B是由SmartSniff報告的數據包大小)
好,最大的區別是在阿魯巴的<!DOCTYPE
前面的三個點。它們是UTF-8 BOM(0xef 0xbb 0xbf)。
作爲兩臺服務器上的相同PHP源代碼,它爲什麼只出現在一臺服務器上?
內容已生成,因此發佈作者無法故意插入BOM,並且我已驗證該模板也是免費的BOM。 服務器上自然有不同的PHP和Apache版本......我可以檢查或設置什麼來診斷和解決問題?順便說一下,我不想要BOM。
非常感謝提前。
你確定你檢查了BOM的所有文件嗎?即不僅是所要求的,還包括所有的要求。 – chelmertz 2009-11-29 03:40:29
chelmertz,你是對的:-(我忘了一個小文件,它有一個BOM ...它在一個插件中,我不得不通過ftp下載整個博客,並用我已經完成的一個小程序檢查每個文件(我不能在阿魯巴的服務器上執行此操作),並且我找到了它。感謝讓我再次檢查所有內容;-) – Paolo63 2009-11-29 17:55:06