php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30469 Cannot use Session In Shell mode
Submitted: 2004-10-18 10:31 UTC Modified: 2004-10-18 10:32 UTC
From: xianglei at xinruinet dot com Assigned:
Status: Not a bug Package: Session related
PHP Version: 4.3.8 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: xianglei at xinruinet dot com
New email:
PHP Version: OS:

 

 [2004-10-18 10:31 UTC] xianglei at xinruinet dot com
Description:
------------
I found that session_start() function can not use when i wrote php as a shell script.

Reproduce code:
---------------
#!/usr/local/php/bin/php
<?
session_start();
?>

Expected result:
----------------
Warning: session_start() [http://www.php.net/function.session-start]: Cannot send session cookie - headers already sent in /home/sms/php/test.php on line 3

Warning: session_start() [http://www.php.net/function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/sms/php/test.php:3) in /home/sms/php/test.php on line 3

Actual result:
--------------
Warning: session_start() [http://www.php.net/function.session-start]: Cannot send session cookie - headers already sent in /home/sms/php/test.php on line 3

Warning: session_start() [http://www.php.net/function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/sms/php/test.php:3) in /home/sms/php/test.php on line 3

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-10-18 10:32 UTC] derick@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Sep 02 19:00:03 2025 UTC