php3-list | 199903

Re: [PHP3] gzipping to stdout? From: Adam Coyne (adam <email protected>)
Date: 03/25/99

Sorry, I should clarify that-- I have a windows app which pulls gzipped data
from the web server by loading a php page, so I do want compressed output to
be sent to the browser. The way I'm doing it now accomplishes what I want,
but with a slight delay before data begins streaming out... I'm curious if
there's a way to send it straight to stdout, rather than writing it to a gz
file and then sending that.

(I figured I could write it to /dev/stdout, but got permission denied trying
to gzopen it, although I can cat stuff to /dev/stdout if I 'su nobody', whom
apache is running as... I was guessing it might be a restriction of running
php as a module or something.)

--
Adam Coyne -- adam <email protected>

----- Original Message ----- From: Rasmus Lerdorf <rasmus <email protected>> To: Adam Coyne <adam <email protected>> Cc: <php3 <email protected>> Sent: Thursday, March 25, 1999 12:09 AM Subject: Re: [PHP3] gzipping to stdout?

> > I'm running PHP 3.0.7 as an Apache module, and using the zlib functions to > > generate compressed output. (it isn't human-readable-- it's going to be used > > by another program.) > > > > Currently I'm writing data to a temporary gz file, then calling readfile to > > send it to the client. Unfortunately, this way there's a slight delay while > > the file is being created before data begins getting sent out. Is there any > > way to do this directly? I tried doing gzopen("/dev/stdout", "wb"), but I > > got a Permission Denied error. > > Well, stdout from a web page goes to the browser. You obviously don't > want to send it there. I would popen() the receiving application > directly, or alternatively set up a named pipe and write to that. > > -Rasmus

-- PHP 3 Mailing List http://www.php.net/ To unsubscribe send an empty message to php3-unsubscribe <email protected> To subscribe to the digest list: php3-digest-subscribe <email protected> For help: php3-help <email protected> Archive: http://www.php.net/mailsearch.php3 List administrator: zeev-list-admin <email protected>