From:             [EMAIL PROTECTED]
Operating system: linux 2.4.1 on a LFS (www.LinuxFromScratch.org)
PHP version:      4.0.4pl1
PHP Bug Type:     Zlib Related
Bug description:  Couldn't access all file via gz* functions


I have php 4.0.4pl1 under Apache. My zlib is version 1.1.2.

I've had problems accessing gz compressed file : 
This happens in the middle of a file : 'gzeof' don't catch
any EOF, but 'gzgetc' returns false as it was the end of the
file. Same for 'gzread' which acts exactly as if it had
encountered an EOF.
I open the compressed file for writing, and write with the
lines (and only these one): 

$zp = gzopen($this->file, "ab9");
gzwrite($zp,  strlen($string) . chr(0)
            . $string         . chr(0)
            . "0"             . chr(0)
           , strlen($string) + strlen(strlen($string)) + 4);

I open the compressed file for reading, and read with the
lines (and only these ones): 

$zp = gzopen($this->file, "rb");
$char = gzgetc($zp);
$string = gzread($zp, $SizeOfString);

This simple script can't read all the file : 

// Note : The file is 68 bytes long uncompressed, and 128
compressed (this info has been read with ls -al)

 $fd = gzopen($file,"rb");
 echo bin2hex(gzread ($fd, 1000));
 gzclose($fd);



This happens on ext2 file system, and vfat. But doesn't
happen under a foreign server (which I don't know the exact
configuration, but has only php 3.16 probably running under
apache on a linux 2.2.14 (for more info on this server go :
http://neosyris.free.fr/testphp.php3)). Their zlib is
version 1.1.3.

I've gunzipped the file I couldn't read in PHP, and read it
without any problems with gz* function by taking of the "9"
in the gzopen function. Although it seems it make the same
problems with other compression values.

I've opened the gunzziped file, and this one contains only
normal caracters except the '00' char. (checked this with
'hexdump showbug -c').

my configure line : 

--prefix=/usr/apps/apache --with-zlib --with-mysql
--with-apxs=/usr/apps/apache/bin/apxs
--with-config-file-paht=/usr/apps/apache/conf

I hope this could help. Last thing : I placed a file that
causes problems on http://neosyris.free.fr/showbug.gz


-- 
Edit Bug report at: http://bugs.php.net/?id=9872&edit=1



-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to