Be aware that contrary to the way this makes it sound, under Apache, php://output and php://stdout don't point to the same place.
<?php
$fo = fopen('php://output', 'w');
$fs = fopen('php://stdout', 'w');
fputs($fo, "You can see this with the CLI and Apache.\n");
fputs($fs, "This only shows up on the CLI...\n");
fclose($fo);
fclose($fs);
?>
Using the CLI you'll see:
You can see this with the CLI and Apache.
This only shows up on the CLI...
Using the Apache SAPI you'll see:
You can see this with the CLI and Apache.