私は2つの異なるブログを管理しています。どちらも wordpress 2.8.6 です (したがって、ソース コードはまったく同じで、プラグインは異なります) が、2 つの異なるホスティング プラットフォーム (hostmonster.com と aruba.it) に配置されています。私の問題を説明するために、SmartSniff を使用して各サイトとのセッションをダンプしました。
以下は、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 によって報告されたパケット サイズです)
OK、大きな違いは<!DOCTYPE
in aruba の前にある 3 つのドットです。それらは UTF-8 BOM (0xef 0xbb 0xbf) です。
両方のサーバーで同じ PHP ソースを使用しているのに、一方のサーバーにしか表示されないのはなぜですか?
投稿者が故意に BOM を挿入できないようにコンテンツが生成されます。また、テンプレートが BOM なしであることも確認しました。当然、サーバーにはさまざまな PHP と Apache のバージョンがあります... 問題を診断して解決するために、何を確認または設定できますか? ところで、BOM は必要ありません。
よろしくお願いします。