运行我的脚本时,我收到几个这样的错误:
警告:不能更改头信息-头已经发出(输出开始/some/file.php:12)在/some/file.php上线23
错误消息中提到的行包含header()和setcookie()调用.
这可能是什么原因?以及如何解决它?
我管理两个不同的博客.它们都是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">
Run Code Online (Sandbox Code Playgroud)
现在来自阿鲁巴:
GET /blog/ HTTP/1.1
Host: www.cubanite.net
Accept-Encoding: identity
Accept-Language: en-us …Run Code Online (Sandbox Code Playgroud)