ID: 47937 Updated by: il...@php.net Reported By: t...@php.net -Status: Verified +Status: Closed Bug Type: Output Control PHP Version: 5.2.9 New Comment:
This bug has been fixed in CVS. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. FYI Jani: -q for cgi sets headers_sent setting to 1 right a way, hence the different result. Previous Comments: ------------------------------------------------------------------------ [2009-04-15 11:31:32] lbarn...@php.net Verified, system() calls sapi_flush() ------------------------------------------------------------------------ [2009-04-13 22:25:17] t...@php.net On FreeBSD with 5.2.9 the SAPI is apache2handler The MacOSX 5.2.9 and 5.3.0RC1 is cli. Do you still need me to try this on Linux? If so, I could compile 5.2.9 and 5.3.0RC1 on Ubuntu tomorrow. ------------------------------------------------------------------------ [2009-04-13 18:04:20] j...@php.net Interesting: # php-cgi -n t.php X-Powered-By: PHP/5.2.9 Content-type: text/html bool(false) string(0) "" int(0) # php-cgi -q -n t.php bool(true) string(0) "" int(0) What SAPI are you using..? ------------------------------------------------------------------------ [2009-04-13 18:01:45] j...@php.net I can not reproduce this with Linux. Please try without the Suhosin patch. ------------------------------------------------------------------------ [2009-04-09 13:55:04] t...@php.net Description: ------------ This is the php -v from one of the servers: PHP 5.2.9 with Suhosin-Patch 0.9.7 (cli) (built: Apr 9 2009 03:31:34) Copyright (c) 1997-2009 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies This is another one (macosx): PHP 5.2.9 (cli) (built: Apr 2 2009 16:07:08) Copyright (c) 1997-2009 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies with Xdebug v2.0.4, Copyright (c) 2002-2008, by Derick Rethans Right after my system() call, headers were send. This works differently in 5.2.6 and 5.2.8. I've scanned through UPDATING/CHANGELOG but couldn't find anything. I've disabled APC to make sure it's not connected. php -m: [PHP Modules] ctype date dom filter iconv libxml mbstring mcrypt mysqli pcre Reflection session SimpleXML sockets SPL standard tidy xml zlib Also reproduced with RC1 on 5.3: PHP 5.3.0RC1 (cli) (built: Apr 9 2009 15:45:09) Copyright (c) 1997-2009 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies Reproduce code: --------------- <?php ob_start(); system('file -i -b /path/file.txt'); $contents = ob_get_contents(); ob_end_clean(); var_dump(headers_sent($file, $line), $file, $line); Expected result: ---------------- headers_sent() should return false. Actual result: -------------- headers_sent() returns true, with empty $file and $line = 0. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=47937&edit=1