[PHP] Gzipped output

2008-02-10 Thread Jakub

Hello,
is it possible to make something like "gzipped echo"?.
My idea was:
$gzOut = gzopen('php://output','w');
but it fails with an error: Warning:  gzopen(php://output) [href='function.gzopen'>function.gzopen]: could not make seekable - 
php://output


That script generates a large text file to download, so I thought I can 
gzip it somehow to make the downloads faster. The buffered way (to load 
all the output to some $buffer and then echo gzencode($buffer,6);) 
consumes too much memory.

Can anyone help me with this?

Best regards

Jakub Cermak

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Gzipped output

2008-02-10 Thread Jakub
Yes, I thought about this, but this has a big disadvantage - the client 
must wait for the file to be fully processed and compressed and then he 
can start downloading. I'd like to let the client start downloading the 
compressed parts while the further parts are still being processed and 
compressed - it's similar to streaming concept. I hope you can see what 
I mean.


Jakub Čermák
[EMAIL PROTECTED]
ICQ 159971304



Per Jessen napsal(a):

Jakub wrote:

  

That script generates a large text file to download, so I thought I
can gzip it somehow to make the downloads faster. The buffered way (to
load all the output to some $buffer and then echo
gzencode($buffer,6);) consumes too much memory.



You could write it to a local file, then do:

header("Content-Type: application/x-gzip");
Header("Content-Disposition: attached; filename=\"\"")

passthru("gzip -c ");


/Per Jessen, Zürich

  


Re: [PHP] Gzipped output

2008-02-10 Thread Jakub
That would do the trick if it was allowed at the server  but it 
isn't :( And it's not my server and I can't change its settings.


Jakub Čermák
[EMAIL PROTECTED]
ICQ 159971304



Per Jessen napsal(a):

Jakub wrote:

  

Yes, I thought about this, but this has a big disadvantage - the
client must wait for the file to be fully processed and compressed and
then he can start downloading. I'd like to let the client start
downloading the compressed parts while the further parts are still
being processed and compressed - it's similar to streaming concept. I
hope you can see what I mean.



Maybe apaches mod_deflate is what you're after?  That will do in-flight
compression. 



/Per Jessen, Zürich

  


[PHP] PHP 4.2.2 & vpopmail

2002-07-29 Thread Jakub Zawierucha

I have little problem with vpopmail functions from PHP 4.2.2. When I use 
  vpopmail_auth_user ( "blah", "foo.bar.pl", "secret string" ); I get no 
correct return value ( echo vpopmail_auth_user ( "blah", "foo.bar.pl", 
"secret string" ); - give me no result ). This values are 100% good. I 
have Apache with suEXEC (VirtualHost -> User vpopmail, Group vchkpw).


Here's details:

My Apache:
 ./configure \
 --enable-suexec \
 --suexec-caller=www-data \
 --suexec-docroot=/usr/local/apache \
 --server-uid=www-data \
 --server-gid=www-data \
 --enable-module=log_referer \
 --enable-module=usertrack \
 --disable-module=imap \
 --activate-module=src/modules/php4/libphp4.a \
 --prefix=/usr/local/apache

cd src
# ADD line "AddModule modules/php4/libphp4.a" in Configure
./Configure
make
cd ..
make install

My PHP:

 ./configure \
 --enable-tokenizer \
 --enable-track-vars \
 --enable-ftp \
 --enable-safe-mode \
 --with-vpopmail="/home/vpopmail" \
 --with-apache=${SRC_APACHE_DIR} \
 --prefix=/usr/local

 make;make install

infophp(); produce:

vpopmail version  5.2.1
vpopmail uid/gid php uid/gid/euid/egid 89/89 33/33/33/33
vpopmail dir /home/vpopmail
vpopmail vadddomain  /home/vpopmail/bin/vadddomain
vpopmail vdeldomain  /home/vpopmail/bin/vdeldomain
vpopmail vaddaliasdomain /home/vpopmail/bin/vaddaliasdomain
vpopmail valias support  Enabled


UIDs and GIDs :

# cat /etc/group | grep 'vchkpw'
vchkpw:x:89:
# cat /etc/passwd | grep 'vpopmail'
vpopmail:x:89:89::/home/vpopmail:/bin/bash
# cat /etc/passwd | grep 'www-data'
www-data:x:33:33:www-data:/var/www:/non

Is this problem of my configuration or broken code of php extensions ?
--

---= Jakub Zawierucha teku(at)teku.ptc.pl.nospam - remove .nospam =---


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] PHP 4.2.2 & vpopmail

2002-07-30 Thread Jakub Zawierucha

Uz.ytkownik Jakub Zawierucha napisa?:
> I have little problem with vpopmail functions from PHP 4.2.2. When I use 
>  vpopmail_auth_user ( "blah", "foo.bar.pl", "secret string" ); I get no 
> correct return value ( echo vpopmail_auth_user ( "blah", "foo.bar.pl", 
> "secret string" ); - give me no result ). This values are 100% good. I 
> have Apache with suEXEC (VirtualHost -> User vpopmail, Group vchkpw).
> 
> 
> Here's details:
> 
> My Apache:
> ./configure \
> --enable-suexec \
> --suexec-caller=www-data \
> --suexec-docroot=/usr/local/apache \
> --server-uid=www-data \
> --server-gid=www-data \
> --enable-module=log_referer \
> --enable-module=usertrack \
> --disable-module=imap \
> --activate-module=src/modules/php4/libphp4.a \
> --prefix=/usr/local/apache
> 
> cd src
> # ADD line "AddModule modules/php4/libphp4.a" in Configure
> ./Configure
> make
> cd ..
> make install
> 
> My PHP:
> 
> ./configure \
> --enable-tokenizer \
> --enable-track-vars \
> --enable-ftp \
> --enable-safe-mode \
> --with-vpopmail="/home/vpopmail" \
> --with-apache=${SRC_APACHE_DIR} \
> --prefix=/usr/local
> 
> make;make install
> 
> infophp(); produce:
> 
> vpopmail version  5.2.1
> vpopmail uid/gid php uid/gid/euid/egid 89/89 33/33/33/33
> vpopmail dir /home/vpopmail
> vpopmail vadddomain  /home/vpopmail/bin/vadddomain
> vpopmail vdeldomain  /home/vpopmail/bin/vdeldomain
> vpopmail vaddaliasdomain /home/vpopmail/bin/vaddaliasdomain
> vpopmail valias support  Enabled
> 
> 
> UIDs and GIDs :
> 
> # cat /etc/group | grep 'vchkpw'
> vchkpw:x:89:
> # cat /etc/passwd | grep 'vpopmail'
> vpopmail:x:89:89::/home/vpopmail:/bin/bash
> # cat /etc/passwd | grep 'www-data'
> www-data:x:33:33:www-data:/var/www:/non
> 
> Is this problem of my configuration or broken code of php extensions ?

I solve that problem. Apache was not runed as vpopmail.vchkpw. Suexec is 
useless until you turn php as cgi. The better way (than suexec) is run 
separate apache server as vpopmail.vchkpw user on other port. Now 
vpopmail functions are ok.

-- 

  ---= Jakub Zawierucha teku(at)teku.ptc.pl.nospam - remove .nospam =---

ps. Sorry for my english ;P


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php