|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-06-27 05:03 UTC] derick@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Sat May 30 19:00:01 2026 UTC |
Description: ------------ This little script 1 2 <?php 3 session_start(); 4 ?> 5 session inizializzata must to be produce a warning (line 1 is empty so something is send to header). But there is a problem: there are 2 warning: Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/httpd/html/LIBRO/sessioni/1.php:2) in /home/httpd/html/LIBRO/sessioni/1.php on line 3 Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/httpd/html/LIBRO/sessioni/1.php:2) in /home/httpd/html/LIBRO/sessioni/1.php on line 3 session inizializzata I have no php.ini set, so there is the default. Some value from phpinfo(): display_errors => On => On display_startup_errors => Off => Off error_append_string => no value => no value error_log => no value => no value error_prepend_string => no value => no value error_reporting => no value => no value html_errors => Off => On ignore_repeated_errors => Off => Off log_errors => Off => Off log_errors_max_len => 1024 => 1024 track_errors => Off => Off session.auto_start => Off => Off session.cookie_domain => no value => no value session.cookie_lifetime => 0 => 0 session.cookie_path => / => / session.cookie_secure => Off => Off bye Reproduce code: --------------- 1 2 <?php 3 session_start(); 4 ?> 5 session inizializzata Expected result: ---------------- Only one warning. Actual result: -------------- Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/httpd/html/LIBRO/sessioni/1.php:2) in /home/httpd/html/LIBRO/sessioni/1.php on line 3 Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/httpd/html/LIBRO/sessioni/1.php:2) in /home/httpd/html/LIBRO/sessioni/1.php on line 3 session inizializzata