ID: 22079 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Feedback Bug Type: Output Control Operating System: RedHat 7.2 PHP Version: 4CVS-2003-02-05 (stable)
Previous Comments: ------------------------------------------------------------------------ [2003-02-05 15:40:20] [EMAIL PROTECTED] This isn't the source of 'problem.php' as the 'header already sent' points to line 3, which is the header command itself. It never points to the header line itself. Please include post script, so that the correct line is reported. Also -> this is bound to fail, as line 4 outputs stuff. The header function != redirect. You should call exit after after the header command. I'm leaving this open, since user reports it works in the module version. ------------------------------------------------------------------------ [2003-02-05 12:30:00] [EMAIL PROTECTED] 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 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=22079&edit=1