At the writing of:
<?php
session_start();
?>
An error message appeared:
Warning: session_start() [function.session-start]:
Cannot send session cache limiter – headers already sent (output started at X:/home/localhost/www/phpbloguser/header.html:6) in X:/home/localhost/www/phpbloguser/blocks/global.inc.phpon line 110
In php.ini it is necessary to write directive output_buffering “On” (on default – Off), see php.ini. And it will be all right! To make it works it is necessary to restart your server.
This error may appear for other reasons as well:
It is necessary to check if there is a space, tab, hyphen before “<?”.
In addition, it is necessary to start a session before any text appear in the browser’s window. Because in this case session identifier is written down in cookie files. Cookies in their turn are always installed through headers sending. The error message says that headers have ALREADY been sent.
Therefore it is necessary to check if any text appears in the browser’s window before you start a session by means of session_start()?
Your php file must be saved in UTF 8 coding (without BOM). If it is with BOM, three symbols will be typed at the beginning of the file and this results in this error.
Recent Comments