Using fopen('php://stdout') with apache

From: Date: Sat, 24 Sep 2005 19:09:51 +0000
Subject: Using fopen('php://stdout') with apache
Groups: php.general 
Request: Send a blank email to php-general+get-223126@lists.php.net to get a copy of this message
I'm trying to move some code that was written for the CLI to the web. It makes extensive use fprintf() and fputs() and under Apache2 it give no output. The simple test case that demonstrates the problem looks like: <?php $fp = fopen('php://stdout', 'w'); if ($fp === false) { die('open failed.'); } print "You can see this with the CLI and Apache.\n"; fputs($fp, "This only shows up on the CLI...\n"); fclose($fp); ?> Using php-cli on FreeBSD: amorton@multivac:/home/www/multivac> php phptest.php You can see this with the CLI and Apache. This only shows up on the CLI... Viewing the page using Apache2 and mod_php5: You can see this with the CLI and Apache. Anyone know how to get a reference to the standard output to work with the Apache2 SAPI? Thanks, andrew

« previous php.general (#223126) next »