Saeven
02-08-2004, 10:08 PM
Fedora and RH9 are packaged with faulty zlibs, and seemingly a quick fix is to turf the packaged version, and relink using a recompiled zlib 1.1.4, recompiling php source on top (and any other subcomponents of course).
The trademark signature of a broken fedora/zlib is segfaults in the apache log. Do check to make sure this is the case.
Here is a todo list of steps required to fix these bad bad distros:
1. Build a source directory on your server, /source does the job
1. Download zlib 1.1.4.tar.gz from zlib's site, or any reliable distro
2. Unpack using tar -zxf
3. Access zlib directory
4. run in order:
./configure --shared
make
make install
This will store libs in /usr/local/lib
5. Download php source from php.net, store in /source, and unpack with tar -zxf, CD into directory.
6. Build a phpinfo page:
<?php
phpinfo( -1 );
?>
Save it somewhere on your webroot, and access it in browser. Copy the top table 'configure' command and paste into a second file. Strip all single quotation marks from this file and locate the --with-zlib command. Change it to --with-zlib=/usr/local/
7. Save this new command in your php source directory as a file called phpcompile
8. chmod 700 phpcompile
9. run, in order:
./phpcompile
make
make install
10. At this point we have PHP recompiled on ZLIB 1.1.4 configured as shared module - we just have to update the symlinks.
11. Access /usr/lib and ls -l libz* you will see the libz pointing to the newer and faulty zlib so's. You need to remove these symlinks and recreate them for the new (old actually) object we've compiled in the first few steps. Delete the old symlink, and create a new one:
ex.
ln -s /usr/local/lib/libz.so.1.1.4 libz.so.1
There are two such links to be recreated (remember to delete the old symlink first).
12. Restart apache
13. Access your phpinfo page anew, if you've done these correctly, you will see:
a) the configure command will reflect the one you built in the phpcompile page above
b) the zlib section will read 1.1.4 in both version boxes (linked and compiled)
c) the segfaults will no longer occur.
Good luck!
Alex
The trademark signature of a broken fedora/zlib is segfaults in the apache log. Do check to make sure this is the case.
Here is a todo list of steps required to fix these bad bad distros:
1. Build a source directory on your server, /source does the job
1. Download zlib 1.1.4.tar.gz from zlib's site, or any reliable distro
2. Unpack using tar -zxf
3. Access zlib directory
4. run in order:
./configure --shared
make
make install
This will store libs in /usr/local/lib
5. Download php source from php.net, store in /source, and unpack with tar -zxf, CD into directory.
6. Build a phpinfo page:
<?php
phpinfo( -1 );
?>
Save it somewhere on your webroot, and access it in browser. Copy the top table 'configure' command and paste into a second file. Strip all single quotation marks from this file and locate the --with-zlib command. Change it to --with-zlib=/usr/local/
7. Save this new command in your php source directory as a file called phpcompile
8. chmod 700 phpcompile
9. run, in order:
./phpcompile
make
make install
10. At this point we have PHP recompiled on ZLIB 1.1.4 configured as shared module - we just have to update the symlinks.
11. Access /usr/lib and ls -l libz* you will see the libz pointing to the newer and faulty zlib so's. You need to remove these symlinks and recreate them for the new (old actually) object we've compiled in the first few steps. Delete the old symlink, and create a new one:
ex.
ln -s /usr/local/lib/libz.so.1.1.4 libz.so.1
There are two such links to be recreated (remember to delete the old symlink first).
12. Restart apache
13. Access your phpinfo page anew, if you've done these correctly, you will see:
a) the configure command will reflect the one you built in the phpcompile page above
b) the zlib section will read 1.1.4 in both version boxes (linked and compiled)
c) the segfaults will no longer occur.
Good luck!
Alex
