php inserts HEX number of characters before the content

后端 未结 3 543
無奈伤痛
無奈伤痛 2020-12-21 10:42

I\'m moving a website to a new server. (Old server had php 5.3.2, the new one has php 5.5.9) Centos, httpd Apache/2.2.26.

I\'ve copied files and it works fine except

3条回答
  •  悲&欢浪女
    2020-12-21 11:13

    As discussed in the PHP chat room yesterday 9F 1A is the BOM for UTF-16BE Encoding

    In my case only two headers are sent from php script:

    header("HTTP/1.1 200 OK"); header("Status: 200");

    What's going here? Why are you setting both? One is a proper http response, the other is a CGI response. You shouldn't need to set either, as PHP will default to a 200 OK if the script completes. And setting a CGI style header is probably wrong, unless you're definitely running PHP in CGI mode through Apache.

提交回复
热议问题