|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-02-05 15:40 UTC] msopacua@php.net
[2003-02-05 16:25 UTC] zlo at canada dot com
[2003-02-05 17:26 UTC] zlo at canada dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Dec 05 01:00:02 2025 UTC |
What i am trying to do: send headers What happens: headers don't get sent under the excuse that "output already started" if any messages have been logged by error_reporting, although no output has been sent to the browser. (logging goes to error_log) If i disable reporting E_NOTICE or logging, problem disappears. this happens under php 4.3.0 and the fresh snapshot from Feb 5, when used in cgi mode in the following ways: Action php-script /php4/php -or- #!/usr/bin/php it DOES NOT happen under mod_php 4.3.0 code that exhibits the problem: (i expect to get redirected to ok.php but i see hi instead) if i remove the errorneous line that causes warnings, it works as intended. <?php $res=$na['na']; header('Location: ok.php'); echo 'hi'; ?> error_log: PHP Notice: Undefined variable: na in /www/mysite/htdocs/problem.php on line 2 PHP Warning: Cannot modify header information - headers already sent in /www/mysite/htdocs/problem.php on line 3 configure options: ./configure \ --with-config-file-path=/svr/php-cgi \ --prefix=/svr/php-cgi \ --enable-force-cgi-redirect \ --disable-cli \ --enable-bcmath \ --enable-trans-sid \ --with-zlib-dir=/build/zlib-1.1.4 \ --with-gd=/build/gd-1.8.4 \ --with-png-dir=/build/png-1.2.4 \ --with-jpeg-dir=/build/jpeg-6b \ --with-freetype \ --with-mysql=/usr/local \ --with-gettext \ --with-imap \ --with-imap-ssl \ --with-kerberos \ php.ini, relevant options: error_reporting E_ALL output_buffering On log_errors on display_errors off