Using PHP 5.3 as php5_module in Apache 2.2 on Windows 7.
Where does stdout go in the above configuration?
Tested with following code:
<?php
$stdout = fopen('php://stdout', 'w');
fwrite($stdout, "stdout<br />\n");
$output = fopen('php://output', 'w');
fwrite($output, "output<br />\n");
?>
This only displays output in the browser. What happens to stdout?
As the manual shows on the php:// wrappers manual page:
So if you want to write output to the browser, use
php://outputOn the other hand,
php://stdoutIn the case of Apache, this output is Apache’s stdout handle which is generally never seen anywhere because this is console output for Apache and it is usually run in the background. If you were to run Apache in the foreground on your console, anything you write to
php://stdoutwould be visible on the console. Since Apache is run in the background, nostdoutdata is captured or written anywhere normally.To test this, follow these steps:
/usr/local/apache2/bin/httpd -D FOREGROUND -k start)stdoutoutput on the console.