#47937 [Fbk->Ver]: headers_sent() reports 'true' after system() call in ob_start()
ID: 47937
Updated by: lbarnaud@php.net
Reported By: till@php.net
-Status: Feedback
+Status: Verified
Bug Type: Output Control
Operating System: FreeBSD, MacOSX
PHP Version: 5.2.9
New Comment:
Verified, system() calls sapi_flush()
Previous Comments:
------------------------------------------------------------------------
[2009-04-13 22:25:17] till@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] jani@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] jani@php.net
I can not reproduce this with Linux. Please try without the Suhosin
patch.
------------------------------------------------------------------------
[2009-04-09 13:55:04] till@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
Thread (7 messages)