As shown in the manual on the php: // wrappers page:
php: // output is a write-only stream that allows you to write to the output buffer mechanism in the same way as printing and echoing .
So, if you want to write the output to the browser, use php://output
php://stdout , on the other hand
allow direct access to the corresponding input or output stream of the PHP process.
In the case of Apache, this output is an Apache descriptor descriptor that usually never occurs because it is console output for Apache and it usually runs in the background. If you want to run Apache in the foreground on the console, everything you write in php://stdout will be visible on the console. Because Apache runs in the background, stdout data is not written or written anywhere.
To verify this, follow these steps:
- Launch Apache in the foreground (e.g.
/usr/local/apache2/bin/httpd -D FOREGROUND -k start ) - Leave the console window open.
- Run the script from the browser
- Look at your
stdout output on the console.
drew010
source share