Weird error with sessions
| From: | Derick Rethans | Date: | Fri, 31 Aug 2001 13:38:31 +0000 |
| Subject: | Weird error with sessions | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-64808@lists.php.net to get a copy of this message | ||
Hello,
Script:
------------------
<?php session_start(); ?>
------------------
This command:
php -q sessiontest.php shows this:
[root@mars scripts]# php -q bug00001.php
<br>
<b>Warning</b>: Cannot send session cookie - headers already sent in
<b>/dat/dev/srm/test/scripts/bug00001.php</b> on line <b>2</b><br>
/dat/dev/srm/test/scripts/bug00001.php(2) : Warning - Cannot send session
cookie - headers already sent
<br>
<b>Warning</b>: Cannot send session cache limiter - headers already sent
(output started at /dat/dev/srm/test/scripts/bug00001.php:2) in
<b>/dat/dev/srm/test/scripts/bug00001.php</b> on line <b>2</b><br>
/dat/dev/srm/test/scripts/bug00001.php(2) : Warning - Cannot send session
cache limiter - headers already sent (output started at
/dat/dev/srm/test/scripts/bug00001.php:2)
<br>
<b>Fatal error</b>: Failed to initialize session module in
<b>/dat/dev/srm/test/scripts/bug00001.php</b> on line <b>2</b><br>
/dat/dev/srm/test/scripts/bug00001.php(2) : Fatal error - Failed to
initialize session module
[root@mars scripts]#
php sessiontest.php shows this:
X-Powered-By: PHP/4.0.8-dev
Set-Cookie: PHPSESSID=72acab12384f04e6211a8f3408b5747e; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0,
pre-check=0
Pragma: no-cache
Content-type: text/html
<br>
<b>Fatal error</b>: Failed to initialize session module in
<b>/dat/dev/srm/test/scripts/bug00001.php</b> on line <b>2</b><br>
/dat/dev/srm/test/scripts/bug00001.php(2) : Fatal error - Failed to
initialize session module
This last error is normal, as the session module is off-line at this
moment, but why is -q showing the Headers already sent error, and without
parameters it works ok? No clue yet, but I'll go digging.
regards,
Derick Rethans
---------------------------------------------------------------------
PHP: Scripting the Web - www.php.net - derick@php.net
SRM: Site Resource Manager - www.vl-srm.net
---------------------------------------------------------------------
JDI Media Solutions - www.jdimedia.nl - d.rethans@jdimedia.nl
Boulevard Heuvelink 102 - 6828 KT Arnhem - The Netherlands
---------------------------------------------------------------------