Użytkownik "Charles Polisher" <cp*****@nonesuch.comnapisał w wiadomo¶ci
news:sl********************@kevin.peecee3.com...
MZ <ma**************@poczta.onet.plwrote:
>Hello!
I`ve tried to instal zlib library to use zip functions to pack files into
zip archive.
I don`t know how I have to configure zlib to make it work.
I have built up php.ini file and I`ve put such line
--with-zlib=/home/domena_nazwa/domains/test.com/public_html/gallery/lib/zziplib.lib
but unfortunately it doesn`t work
I have tried
--with-zlib=/gallery/lib/
and it also doesn`t set up the with-zlib line( I`ve checked in phpinfo())
I`ve put php.ini in the folder public_html on my server
What did I do wrong?
What else should I do to use zip library perfectly?
Please help me!
Thank you in advance
M.
MZ,
The --with-zlib line goes in the ./configure line when you build PHP
from source. You can get a list of all the configuration directives with:
./configure --help
You might also be interested in using --with-zlib-dir.
Hope that helps,
--
Charles
I have just noticed that I have ZLIB class enabled - maybe (I have checked
it using phpinfo()):
ZLib Support enabled
Stream Wrapper support compress.zlib://
Stream Filter support zlib.inflate, zlib.deflate
Compiled Version 1.2.3
Linked Version 1.2.3
Directive Local Value Master Value
zlib.output_compression Off Off
zlib.output_compression_level -1 -1
zlib.output_handler no value no value
So why when I do:
$zip = new ZipArchive();
$filename = "photos/zip/".str_replace(" ","",$_GET["gallery_name"]).".zip";
echo $filename;
if ($zip->open($filename, ZIPARCHIVE::CREATE)!==TRUE)
{
exit("cannot open <$filename>\n");
}
$thisdir="/photos/";
$zip->addFile($thisdir."truck1.jpg","truck1.jpg");
echo "numfiles: " . $zip->numFiles . "\n";
echo "status:" . $zip->status . "\n";
$zip->close();
I still get the error like this class is still invisible for php:
Fatal error: Class 'ZipArchive' not found in
/home/test/domains/test.pl/public_html/photos/index.php on line 88
I have got such line in phpinfo():
--with-zlib-dir=/usr/local/lib
Thank you in advance for help
M.