Thursday, December 8, 2016

Solve "Cannot modify header information - headers already sent by *.php"

This Warning is shown by PHP when you use the header function to output headers or use the setcookie function to set cookies after any echo or content which is not inside PHP tag.

SOLUTION:
You can turn on buffering in PHP on by default using php.ini. Look for output_buffering , The following shows the mentioned part of the php.ini file. Set the value as On and restart Apache server.

Just turn

output_buffering = On

in your php.ini


More on the topic at:
http://stackoverflow.com/questions/2658083/setcookie-cannot-modify-header-information-headers-already-sent
http://digitalpbk.com/php/warning-cannot-modify-header-information-headers-already-sent





No comments:

Post a Comment