BOM中的Word preSS产生一个PHP页面自动 [英] BOM in a PHP page auto generated by Wordpress

查看:234
本文介绍了BOM中的Word preSS产生一个PHP页面自动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我联系两个不同的博客。他们都是字preSS 2.8.6(所以他们有完全相同的源$ C ​​$ C,除了插件),但它们是位于两个不同的主机平台(hostmonster.com和aruba.it)。
要解释我的问题,我用甩一个SmartSniff会话使用网站的每一个。

I admin two different blogs. They are both wordpress 2.8.6 (so they have exactly the same source code, plugins apart) but they are located on two different hosting platform (hostmonster.com and aruba.it). To explain my problem I've dumped with SmartSniff a session with each one of the sites.

下面是转储从HostMonster的:

Here is the dump from 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报告分组大小)

(note: a6 and 100b are the packet size reported by SmartSniff)

好吧,最大的区别是三个点的&LT前,在阿鲁巴DOCTYPE !他们是UTF-8 BOM(0xef为0xBB 0xBF时才)。

Ok, the big difference are the three dots in front of the <!DOCTYPE in aruba. They are the UTF-8 BOM (0xef 0xbb 0xbf).

作为两个服务器上相同的PHP源,为何只出现在一台服务器上?

Being the same PHP source on both the servers, why does it appears only on one server ?

的内容产生这样的帖子作者不能刻意插入一个BOM和我已经验证模板是BOM免费的。
当然也有不同的PHP和Apache版本的服务器上......我该怎么检查或设置诊断和解决问题?顺便说一句,我不希望BOM。

The content is generated so the post author can't deliberately insert a BOM and I've verified the template to be BOM free too. Naturally there are different PHP and Apache versions on the servers... what can I check or set to diagnose and resolve the problem ? By the way I don't want the BOM.

提前非常感谢。

推荐答案

的BOM是在PHP源文件中的一个开幕前&LT; PHP 。有时,这会弹出,因为你看到一个写得不好的文本编辑器源,使用的FTP客户端的一个bug,使用的解压缩工具,在BOM自动抛出,接到了一个阴暗的一面镜子,等源$ C ​​$ C 。等等。

The BOM is in one of the PHP source files before the opening <?php. Occasionally, this can pop up because you viewed the source in a poorly written text editor, used an FTP client with a bug, used an unzip tool that automatically threw in the BOM, got the source code from a shady mirror, etc. etc.

我的解决方法是打开主WP文件(的index.php WP - *。PHP ,等)在记事本+ +和Windows / Mac的切换格式Unix和关闭BOM。这将清除任何来源问题的文件。

My solution is to open up the primary WP files (index.php, wp-*.php, etc.) in Notepad++ and switch the format from Windows/Mac to Unix and turn off the BOM. This will clean up the files of any source issues.

你看到它在不同的两个不同的服务器的原因可能是因为服务器运行两个不同的服务器应用程序,或两个不同的操作系统(甚至有两种不同的配置)。该平台的差异会导致您的服务器发送的BOM自己独特的跨pretation。

The reason you're seeing it differently on two different servers could be because the servers are running two different server applications or two different operating systems (or even having two different configurations). The platform disparities would lead to your servers sending out their own unique interpretation of the BOM.

希望这有助于!

这篇关于BOM中的Word preSS产生一个PHP页面自动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆