Entry
When starting apache i get "Cannot load /usr/local/apache_1.3.12/libexec/libphp4.so into server: undefined symbol: uncompress"
undefined reference to `compress'
Nov 5th, 2000 11:33
David Greenberg, Thomas tanghus, Guest, Matthew Gregory, Beauford Beauford, http://www.info-zip.org/pub/infozip/zlib/
"uncompress" comes from libz.so.<version>, which is a DSO library that
must be installed on your system in a library directory. This library
provides support for various compression utilities, similar to the
functionality of the <uncompress> or <gunzip> commands.
If you don't have it already, install the latest version of zlib. (See
the link above.)
Be sure to run <ldconfig> as root to configure your newly installed
libz.so library file. ldconfig creates a shared library cache and
maintains symbolic links to the actual library files, with appropriate
version numbers.
The above problem may occur regardless of whether you configure PHP's
build using the --without-zlib option.
Why?
If you compile in MySQL support -- and most people do -- MySQL's client
library (also a dynamically linked library) requires the functionality
of ZLIB.
To fix the problem, all you have to do, right before you run
PHP's "make", is
to edit your top-level Makefile and modify the following line:
LTLIBRARY_LDFLAGS = -lz [ ... ]
The important part is the -lz, which is not present by default.
Now, you can run make and then make install, and everything should work
fine.
You can verify dependencies of the libphp4.so module as follows:
[davidg@www apache]$ ldd libexec/libphp4.so
libz.so.1 => /usr/lib/libz.so.1 (0x40129000)
libpam.so.0 => /lib/libpam.so.0 (0x40138000)
libdl.so.2 => /lib/libdl.so.2 (0x40140000)
libgd.so.1 => /usr/lib/libgd.so.1 (0x40143000)
libresolv.so.2 => /lib/libresolv.so.2 (0x40179000)
libm.so.6 => /lib/libm.so.6 (0x40188000)
libcrypt.so.1 => /lib/libcrypt.so.1 (0x401a5000)
libnsl.so.1 => /lib/libnsl.so.1 (0x401d2000)
libc.so.6 => /lib/libc.so.6 (0x401e8000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)
[davidg@www apache]$
See how libz is listed? This is *essential*. If this occurs, you
should be in good shape.
P.S: I ran into this problem on RH Linux 6.1 with patches. I have not
tested on other systems. zlib is available for almost every flavor of
UNIX.
PPS: If you don't use MySQL and you don't plan to use the compression
library, configure using --without-zlib.
Cheers!