Specification on a PHP page created by Wordpress

I administer two different blogs. They are both wordpress 2.8.6 (so they have exactly the same source code, the plugins are separate), but they are located on two different hosting platforms (hostmonster.com and aruba.it). To explain my problem, I dropped a session with each of the sites with SmartSniff.

Here is a 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"> 

and now from Aruba:

 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"> 

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

Well, the big difference is the three points before <!DOCTYPE in Aruba. This is the UTF-8 specification (0xef 0xbb 0xbf).

Being the same PHP source on both servers, why is it displayed on only one server?

Content is being created, so the author of the message cannot deliberately insert a specification, and I also verified that the template is also free. Naturally, there are different versions of PHP and Apache on the servers ... what can I check or install to diagnose and fix the problem? By the way, I do not need a specification.

Thank you very much in advance.

0
source share
1 answer

The specification is in one of the PHP source files before opening <?php . Sometimes this may appear because you looked at the source in a poorly written text editor, used the FTP client with an error, used the unpacking tool, which automatically threw the specification, received the source code from a shaded mirror, etc. Etc.

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

The reason you see it differently on two different servers may be because the servers run two different server applications or two different operating systems (or even with two different configurations). Platform differences will cause your servers to send their own unique interpretation of the specification.

Hope this helps!

+5
source

Source: https://habr.com/ru/post/1306351/


All Articles