PHP session code works differently on two servers

I have some code that works fine on one server, but gives a session header warning:

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

another.

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

I know the warning should suggest that something was printed before session_start, but I don't understand why the same code works on one server but not another.

Is there something else that might explain this besides the php.ini settings?

+2


a source to share


4 answers


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



I think you are wrong and one of them has buffering.

+1


a source


Perhaps when transferring files to the second server, you entered blank lines at the end of one of your files?



+2


a source


Have you checked your webserver config as well? The php directives can be set in the Apache httpd.conf and .htaccess files and you get the differences, although the main php.ini files are identical.

What you need to do is compare the output phpinfo()

on both servers. If there are any differences in the server configuration then where will it appear.

0


a source


maybe some invisible characters received at the beginning of one of your files during transfer or something else

0


a source







All Articles