|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-10-05 21:37 UTC] sniper@php.net
[2005-10-05 22:06 UTC] clewis at myfonts dot com
[2005-10-05 23:07 UTC] sniper@php.net
[2005-10-06 02:21 UTC] clewis at myfonts dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 12:00:02 2025 UTC |
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.