【发布时间】:2010-12-21 07:38:44
【问题描述】:
我管理两个不同的博客。它们都是 wordpress 2.8.6(因此它们具有完全相同的源代码,插件不同),但它们位于两个不同的托管平台(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 报告的数据包大小)
好的,最大的区别是阿鲁巴岛 <!DOCTYPE 前面的三个点。它们是 UTF-8 BOM (0xef 0xbb 0xbf)。
两台服务器上都是同一个PHP源码,为什么只出现在一台服务器上?
内容已生成,因此帖子作者不能故意插入 BOM,并且我已验证模板也不含 BOM。 服务器上自然有不同的 PHP 和 Apache 版本......我可以检查或设置什么来诊断和解决问题?顺便说一句,我不想要 BOM。
非常感谢。
【问题讨论】:
-
您确定检查了所有文件的 BOM 吗? IE。不仅是请求的,还有所有包含的。
-
chelmertz,你是对的 :-( 我忘记了一个小文件,它有一个 BOM ......它在一个插件中。我必须通过 ftp 下载整个博客并检查每个文件我在运行中完成的一个小程序(我不能在阿鲁巴的服务器上执行此操作)并且我找到了它。感谢让我再次检查所有内容;-)
标签: php apache wordpress byte-order-mark