How I did it...
I use pdflib, tifflib, jpeglib, zlib, and ttflib at work. Basically, I downloaded all the source code to all those packages, uninstalled the old rpms of them with the --force --nodeps switches, then built them one at a time and installed them with 'make install'
Note that I built apache first, and installed it with the listing for the "maximum versatility DSO installation" section of the readme.CONFIGURE file.
Then, I found where make install had put all the lib files (i.e. .so files) and edited /etc/ld.so.conf to add the path for each lib if it wasn't there.
Then I built php and installed it. When you run ./configure on php, you should do it like this:
./configure --one-of-100-switches | tee >php.log
Then check the php.log file for the things that did or didn't actually configure correctly.
Note that php's autoconf script will no error out on a failed config option, but simply mention it in the log file we made up above.