开发者

PHP Session code work differently on two servers

I have some code which works fine on one server but is giving a session header warning:

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent

on another.

I have checked the php.ini settings on the 开发者_StackOverflow中文版two servers and they are identical.

I know that the warning message is supposed to suggest that something has been outputted before the session_start but what I don't understand is why the same code works on one server but not the other.

Is there anything else that could be explaining it other than the php.ini settings?


Possibly in the transfer of files to the second server you introduced blank lines at the end of one of your files?


I have checked the php.ini settings on the two servers and they are identical.

I think you're wrong, and one of them has buffering on.


Have you checked the web server's configuration as well? php directives can be set in Apache's httpd.conf and .htaccess files, and you'd end up with differences, even though the main php.ini files are identical.

What you should do is compare the output of phpinfo() on both servers. If there are any differences in server configuration, that's where it would show up.


perhaps some invisible characters got at the beginning of one of your files during transfer or whatever

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜