I just started making this .php file and i cant seem to figure out why its throwing this warning
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at C:\Program Files\xampplite\htdocs\projectchest\controlpanel\index.php:1) in C:\Program Files\xampplite\htdocs\projectchest\controlpanel\index.php on line 2
Here is my php.
<?php
session_start();
require_once('../classes/users/BaseUser.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
...
</html>
And here is access to my php.ini file
pastebin dot com / f60d22891 sorry i cant post two links cuz of some spam nonsense
i also found this thread suggested that my permission settings are messed up. i tried this…no luck
PHP session_start fails
Sessions in PHP are based on a cookie (to transmit the
session_id).Cookies are sent as HTTP headers.
HTTP headers can only be sent if no output has already been sent.
The error message you’re getting indicates that the session cookie cannot be sent because some output has already been sent.
Which means you must be sure not to send any ouput (not even one white-space !) before calling
session_start().A couple of ideas :
As a sidenote : you might get this error on some servers, and not on some others, because of the configuration of
output_buffering: if it’s on (it’s Off in your php.ini file), PHP will keep some data in memory before sending them — which means headers can be sent even if a small amount of data seems to have already been sent (In reality, that small amount of data is kept in memory, and not immediatly really sent).