zlib error in php that comes with iworxCP 1.8.1

Dear All,
I am using iworx CP 1.8.1
Everything is fine but now I have problem with zlib compression functions:

When I ran this code ,
<?php

$filename = tempnam(’/tmp’, ‘zlibtest’) . ‘.gz’;
echo "<html>
<head></head>
<body>
<pre>
";
$s = "Only a test, test, test, test, test, test, test, test!
";

// open file for writing with maximum compression
$zp = gzopen($filename, “w9”);

// write string to file
gzwrite($zp, $s);

// close file
gzclose($zp);

// open file for reading
$zp = gzopen($filename, “r”);

// read 3 char
echo gzread($zp, 3);

// output until end of the file and close it.
gzpassthru($zp);
gzclose($zp);

echo "
";

// open file and print content (the 2nd time).
if (readgzfile($filename) != strlen($s)) {
echo “Error with zlib functions!”;
}
unlink($filename);
echo "</pre>
</body>
</html>
";

?>

as
Fatal error: Call to undefined function: gzopen() in /var/www/html/zlibgziptest
.php on line 8

Can any of you help me in finding out the problem…
Urgent please…

thank you,
Ignacius

additional info to trace -zlib error in php in iworx CP 1.8.1

Dear all,
An additional info to trace the problem:
[root@server1 root]# rpm -qa | grep php
php-iworx-4.3.9-2.iworx
php-devel-4.3.9-101.iworx
php-4.3.9-101.iworx
php-mysql-4.3.9-101.iworx
php-imap-4.3.9-101.iworx
php-pear-4.3.9-101.iworx

[root@server1 root]# rpm -qa | grep zlib
zlib-1.1.4-8
zlib-devel-1.1.4-8

These are the packages that are installed.
I didn’t change any values in php.ini nor httpd.conf

When I ran php -i
It showed
Configure Command ‘./configure’ ‘–prefix=/usr’ ‘–bindir=/usr/bin’ ‘–mandir=/usr/share/man’ ‘–localstatedir=/var’ ‘–libdir=/usr/lib’ ‘–datadir=/usr/share’ ‘–includedir=/usr/include’ ‘–sysconfdir=/etc’ ‘–cache-file=…/config.cache’ ‘–with-config-file-path=/etc’ ‘–with-config-file-scan-dir=/etc/php.d’ ‘–disable-debug’ ‘–disable-rpath’ ‘–with-bz2’ ‘–with-db4=/usr’ ‘–with-curl’ ‘–with-exec-dir=/usr/bin’ ‘–with-freetype-dir=/usr’ ‘–with-png-dir=/usr’ ‘–with-gd’ ‘–with-gdbm’ ‘–with-gettext’ ‘–with-ncurses’ ‘–with-gmp’ ‘–with-iconv’ ‘–with-jpeg-dir=/usr’ ‘–with-openssl’ ‘–with-png’ ‘–with-regex=system’ ‘–with-xml’ ‘–with-expat-dir=/usr’ ‘–with-dom=shared,/usr’ ‘–with-dom-xslt=/usr’ ‘–with-dom-exslt=/usr’ ‘–with-xmlrpc=shared’ ‘–with-readline’ ‘–with-pcre=/usr’ ‘–with-zlib’ ‘–with-layout=GNU’ ‘–with-pear=/usr/share/pear’ ‘–with-imap=shared’ ‘–with-imap-ssl’ ‘–with-kerberos’ ‘–with-ldap=shared’ ‘–with-mcrypt’ ‘–with-mysql=shared,/usr’ ‘–with-unixODBC=shared,/usr’ ‘–with-pgsql=shared’ ‘–without-oci8’ ‘–enable-bcmath’ ‘–enable-exif’ ‘–enable-ftp’ ‘–enable-magic-quotes’ ‘–enable-safe-mode’ ‘–enable-sockets’ ‘–enable-sysvsem’ ‘–enable-sysvshm’ ‘–enable-discard-path’ ‘–enable-track-vars’ ‘–enable-trans-sid’ ‘–enable-yp’ ‘–enable-wddx’ ‘–enable-memory-limit’ ‘–enable-bcmath’ ‘–enable-shmop’ ‘–enable-calendar’ ‘–enable-dbx’ ‘–enable-dio’ ‘–enable-mcal’ ‘–enable-mbstring’ ‘–enable-mbstr-enc-trans’ ‘–enable-mbregex’ ‘–enable-inline-optimization’ ‘–enable-gd-native-ttf’ ‘–enable-pic’ ‘–with-apxs2=/usr/sbin/apxs’

thank you,
Ignacius

I made the following script to juse read a gz file and it worked ok:


<? die( gzopen( "/boot/grub/splash.xpm.gz", "r" ) );?>

Can you paste the output of:


php -i | grep zlib

Chris

This is what I get[No output regarding zlib]:
[root@qxsys root]# php -i | grep zlib
[root@qxsys root]#

Ignacius,

Can you run:


php -v

I’m confused because your first php -i output above had the “–with-zlib” configure command in the output but the 2nd php command you ran with the grep had no such mention.

Chris

php zlib - it is not php -i but phpinfo()

Dear friend,
What I have put in my first mail is not php -i but it is phpinfo() in a php script run from my browser.
thank you,
Ignacius

Ahh, ok, making more sense now ;).

Could you post your phpinfo page for me to see and also run the following:


php -v
rpm -qa | grep php

Chris