473,401 Members | 2,139 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,401 software developers and data experts.

zlib instalation and configuring problem

MZ
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.

Jul 22 '08 #1
4 2915
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
Jul 23 '08 #2
K.

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.
Jul 23 '08 #3
K.
Now it works.
I have thought about zlib, but I use zip functions example.

Below zlib functions works:

function compress( $srcFileName, $dstFileName )
{
// getting file content
$fp = fopen( $srcFileName, "r" );
$data = fread ( $fp, filesize( $srcFileName ) );
fclose( $fp );

// writing compressed file
$zp = gzopen( $dstFileName, "w9" );
gzwrite( $zp, $data );
gzclose( $zp );
}

function uncompress( $srcFileName, $dstFileName, $fileSize )
{
// getting content of the compressed file
$zp = gzopen( $srcFileName, "r" );
$data = fread ( $zp, $fileSize );
gzclose( $zp );

// writing uncompressed file
$fp = fopen( $dstFileName, "w" );
fwrite( $fp, $data );
fclose( $fp );
}

compress( "tmp/truck2.jpg", "tmp/truck2.jpg.gz" );

but below functions doesn`t work, because it is zip (not zlib):

$zip = new ZipArchive();
$filename = "./test112.zip";

if ($zip->open($filename, ZIPARCHIVE::CREATE)!==TRUE) {
exit("cannot open <$filename>\n");
}

$zip->addFromString("testfilephp.txt" . time(), "#1 This is a test string
added as testfilephp.txt.\n");
$zip->addFromString("testfilephp2.txt" . time(), "#2 This is a test string
added as testfilephp2.txt.\n");
$zip->addFile($thisdir . "/too.php","/testfromfile.php");
echo "numfiles: " . $zip->numFiles . "\n";
echo "status:" . $zip->status . "\n";
$zip->close();
Thank you for interesting my post
M.
Jul 23 '08 #4
<ha************@poczta.onet.plwrote:
Now it works.
I have thought about zlib, but I use zip functions example.

Below zlib functions works:
<snip>
but below functions doesn`t work, because it is zip (not zlib):

$zip = new ZipArchive();
$filename = "./test112.zip";

if ($zip->open($filename, ZIPARCHIVE::CREATE)!==TRUE) {
exit("cannot open <$filename>\n");
}

$zip->addFromString("testfilephp.txt" . time(), "#1 This is a test string
added as testfilephp.txt.\n");
$zip->addFromString("testfilephp2.txt" . time(), "#2 This is a test string
added as testfilephp2.txt.\n");
$zip->addFile($thisdir . "/too.php","/testfromfile.php");
echo "numfiles: " . $zip->numFiles . "\n";
echo "status:" . $zip->status . "\n";
$zip->close();
Thank you for interesting my post
M.
See: http://us.php.net/manual/en/zip.installation.php
or http://us.php.net/manual/pl/zip.installation.php

Best regards,
--
Charles
Jul 24 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Alan Toppen | last post by:
I was unable to use the ZipFile class in the zipfile module in Python2.4. I got an error that zlib could not be found. Comparing my Python 2.2 installation I noticed Python 2.4 was missing a...
6
by: Laszlo Zsolt Nagy | last post by:
Sorry, I realized that the import zlib was not executed from my (working) service. So here is the question: why can't I use zlib from a win32 service? Is there any way to make it working? ...
0
by: Marko | last post by:
Please, can anyone help me... I have problem with VisualStudio.NET instalation: First step is OK (framework...), but when instalation of .NET begin, after some time I get message "INSTALATION...
1
by: MuZZy | last post by:
Hello, I am pretty new to .NET programming and probably my question has an obvious answer: I am starting to port an existing c++ application to c#.NET The first problem i am facing is that the...
1
by: Dennis Powell | last post by:
Does anyone have a successful implementaion of the zlib.dll in VB. Net they can show me. I'm writting a class encaplsulating zlib functionality and I keep getting a System.NullReferenceException...
1
by: Leif Wessman | last post by:
I enabled automatic gzip compression with the following lines in ..htaccess: php_value zlib.output_compression On php_value zlib.output_compression_level 5 The problem is that the...
4
by: Anonymous | last post by:
Slightly OT, but can't find a zlib specific ng - so hopefuly, someone can point out why uncompressed strings are not matching the original strings (lots of strange characters at end of string). ...
4
by: ZedLep | last post by:
Hello, First of all I'm a relatively inexperienced C++ programmer so this may seem a simple question to answer. I'm trying to use zlib from www.zlib.net to decompress some data. However I run...
0
by: sumandas1982 | last post by:
Hi, I am trying to install Zlib-1.2.3 on my AIX 5.3(becasue Zlib is uninstalled accidentally).When I am compiling the zlib library,I get warning - # ./configure Checking for gcc... Building...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.