Now I'm doing this on Snow Leopard, which is even more fun.
My configure command:
$ sudo ./configure --with-apxs2=/usr/sbin/apxs --with-pear --prefix=/usr/local/php5 --with-libxml-dir=/usr/local --enable-exif --with-openssl=/usr/local/ssl --with-zlib --with-zlib-dir=/usr/local --with-bz2=/opt/local --with-curl=/usr/local --with-jpeg-dir=/opt/local --with-png-dir=/usr/local --with-freetype-dir=/usr/local --with-openssl-dir=/usr/local/ssl/include/openssl --with-gettext=/usr/local --with-mysql=/usr/local/mysql --with-pgsql=/Library/PostgreSQL/8.4/bin --enable-soap --enable-shared --enable-static --with-iconv=shared,/usr/local
bzip2 and libjpeg were installed using MacPorts, but libxml2, openssl, zlib, curl, libpng, freetype, gettext, libiconv, mysql, and postgresql were installed and configured by hand. The reason is that gettext and libiconv are circularly dependent, and installing either via MacPorts causes no end of problems. So I had to install them and any libraries that depend on them by hand.
PHP builds fine, but then it doesn't work.
$ sudo apachectl configtest
httpd: Syntax error on line 115 of /private/etc/apache2/httpd.conf: Cannot load /usr/libexec/apache2/libphp5.so into server: dlopen(/usr/libexec/apache2/libphp5.so, 10): Library not loaded: /usr/local/lib/libcurl.4.dylib\n Referenced from: /usr/libexec/apache2/libphp5.so\n Reason: Incompatible library version: libphp5.so requires version 7.0.0 or later, but libcurl.4.dylib provides version 6.0.0
But that can't possibly be true. I installed curl-7.21.0:
$ otool -L /usr/local/lib/libcurl.4.dylib
/usr/local/lib/libcurl.4.dylib:
/usr/local/lib/libcurl.4.dylib (compatibility version 7.0.0, current version 7.0.0)
Interestingly, I had this exact same problem with libiconv at first, but after changing the library flags in the makefile (see my other php chokes thread), that problem disappeared.
If anyone has any suggestions, please help. This has got to be solvable.