# Build PHP with zlib support



## Shadow2531

I got the admin for my ISP to install the Archive Mail Plugin for Squirrelmail.

Problem is, the plugin requires zlib support in PHP for it to work. However the php package installed was not built with zlib support. The admin said if I give him specific directions, he'll rebuild php, but they have to be super step-by-step, specific directions.

I've read install files and guides, but they are not even close to specific enough.

The server is question is running the following on RedHat ( I think 8)
Apache/1.3.31 (Unix) PHP/4.3.3 mod_perl/1.29

Is there a php 4.3.3 rpm that he can download that will work with apache 1.3.31, that also has zlib support?

If not, he wants to build

php.4.3.10 with imap support and zlib support
zlib 1.2.2 (has no problem building this)
apache 1.3.33 with support for modules etc.

I definitely need more info than ./configure --with-zlib to build php. (a list of ALL dependencies would help)

I can try out your suggestions only on debian woody. I'm on dialup, so the less dependencies I have to download to build, the better.

Also, if you can point me to some new deb packages that I can also try for myself to see if they work with the archive plugin.

On windows, you can use a php apache module or the cgi version. Is that how it works on linux? If so, I would need directions for building the module too.

I built GTK2 (so I could use a newer version of Gaim) on debian before. It took about a week to find, download and build all the dependencies so I could actually build GTK2, but I successfully did that. (So your directions should make at least some sense to me)

It's a lot to ask, but any help is appreciated.

Thanks


----------



## Squashman

You will need to configure and compile it manually.

You will need to configure PHP --with-zlib[=DIR]


----------



## Shadow2531

Yes, but is the zlib directory supposed to be the directory that the built binaries for zlib are at or is the directory supposed to be where zlib.h and the other source files are at?

I'm thinking the latter.

I'm not sure if I actually have to build zlib first, if it's just going to be built into php.

For example, say if I download the zlib source so that zlib.h is at */zlib-1.2.2/zlib.h* :

Would I do this in the php directory?

./configure --with-zlib=/zlib-1.2.2

Or would have have to build the binaries for zlib first?

is --with-imap specified by default or do I have to add that?

All the readmes, install files and guides show you switches you can use, but I don't know which ones are necessary.

Basically I want the same functionality that you get from downloading the win32 php cgi+module binaries.


----------



## Shadow2531

O.K. here's what I did.

Used KDE package manager to install the following packages:

php4 debian package - PHP 4.1.2 (Not the cgi, the php module, which has built-in zlib support).

php4-imap debian package - PHP imap module . It automatically edited /etc/php4/apache/php.ini to load the module.

apache debian package - 1.3.26

I uncommented the LoadModule line in httpd.conf to load the php module.

<?php phpinfo() ?> shows that zlib 1.14 support enabled and zlib foopen support is enabled. It also shows imap support is enabled.

Also, libz.so.1.1.4 is in /usr/lib
There's a symlink to libz.so.1.1.4 named libz.so.1 in /usr/lib

There's also libzvt.so.2.2.10 and a symlink to it named libzvt.so.2

Here's what php was configured with.



Code:


./configure --prefix=/usr
            --with-apxs=/usr/bin/apxs
            --with-regex=php
            --with-config-file-path=/etc/php4/apache
            --disable-rpath
            --disable-debug
            --enable-memory-limit
            --enable-calendar
            --enable-sysvshm
            --enable-track-vars
            --enable-trans-sid
            --enable-bcmath
            --with-bz2
            --enable-ctype
            --with-db2
            --with-icnov
            --with-ndbm
            --enable-exif
            --enable-filepro
            --enable-ftp
            --with-gettext
            --enable-mbstring
            --with-pcre-regex=/usr
            --enable-shmop
            --enable-sockets
            --enable-wddx
            --with-xml=/usr
            --with-expat-dir=/usr
            --enable-yp
            --with-zlib
            --without-pgsql
            --disable-static
            --with-layout=GNU
            --with-curl=shared,/usr
            --with-dom=shared,/usr
            --with-zlib-dir=/usr
            --with-gd=shared,/usr
            --with-jpeg-dir=shared,/usr
            --with-xpm-dir=shared,/usr/X11R6
            --with-png-dir=shared,/usr
            --with-freetype-dir=shared,/usr
            --with-imap=shared,/usr
            --with-ldap=shared,/usr
            --with-mcal=shared,/usr
            --with-mhash=shared,/usr
            --with-mm
            --with-mysql=shared,/usr
            --with-unixODBC=shared,/usr
            --with-recoded=shared,/usr
            --enable-xslt
            --with-xslt-sablot=shared,/usr
            --with-snmp=shared
            --enabled-ucd-snmp-hack
            --with-sybase-ct=shared,/usr
            --with-ttf=shared,/usr
            --with-t1lib=shared,/usr

Installing the packages works as I want it to.

Now the admin should be able to do the same type of thing on RedHat: right?

If not, do you think that should be enough info to build php? I didn't try to build myself.

I'd still like to know if the php module only works with a certain version of apache or not?

Also, have and links to newer RPM packages for php, apache, etc?

Can Redhat handle deb packages like debian can with alien?

Thanks


----------

