ID: 34744 User updated by: clewis at myfonts dot com Reported By: clewis at myfonts dot com Status: Open Bug Type: Output Control Operating System: Windows XP, CentOS 4 PHP Version: 5.0.5 New Comment:
I'm using Apache 2 APXS module on both Windows XP SP2 and CentOS 4.1 (like RHEL 4), if that helps. Previous Comments: ------------------------------------------------------------------------ [2005-10-05 22:04:10] clewis at myfonts dot com It's a pretty simple problem, I don't know how I can be more specific! ------------------------------------------------------------------------ [2005-10-05 21:37:40] [EMAIL PROTECTED] Not enough information was provided for us to be able to handle this bug. Please re-read the instructions at http://bugs.php.net/how-to-report.php If you can provide more information, feel free to add it to this bug and change the status back to "Open". Thank you for your interest in PHP. ------------------------------------------------------------------------ [2005-10-05 20:53:56] clewis at myfonts dot com Description: ------------ Calling the system() function forces the standard Content-type: text/html header output, even when output buffering is on. This behaviour is unlike other output commands such as print, which suppress the "automatic" headers until the output buffer is flushed. Note that replacing system() with print() in the sample code works as expected. Reproduce code: --------------- <?php ob_start(); chdir("/"); system("ls"); ob_end_clean(); header("Content-type: text/plain"); print "Hello World."; ?> Expected result: ---------------- Content-type: text/plain Hello World. Actual result: -------------- Content-type: text/html Warning: Cannot modify header information - headers already sent... Hello World. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=34744&edit=1