Adam is not quite right when he says "without zlib, MySQL and other programs won't run", without zlib, PHP 4.3 MySQL can't take advantage of compression (a feature that is very rarely used and turned off by default in phpMyAdmin).
Also, the correct line to enable it for MySQL "and other programs" is
I'm not too sure why it can't find zlib. zlib comes by default with Mac OS X and developer tools should install the proper headers:
bash-2.05a$ locate libz
...some other stuff...
Why not try '--with-zlib=/usr' which should be redundant unless you've f-d up your library and include paths.
If a header file is missing, then check to see of /usr/include/zlib.h is on your system. If not, install Developer Tools.
Installing gd-bin from fink doesn't do squat because it's not the library or the headers. Besides, you should be using gd2, not gd. Try installing "gd2", "gd2-bin", and "gd2-shlibs" (why there is no "gd-devel" I don't know). Better yet, build just the libpng3*, libjpeg*, freetype2* packages and then use the version of gd2 that came with PHP 4.3 (it has better support for alpha channels as well as can load GIFs).
As for why compile it yourself. I see five reasons
1) Mark installed something that you don't need. Because lack of dynamic loading of extensions in Mac OS X, your binary is bigger than it needs to be.
2) Mark didn't install something you need (for the especially masochistic, try building php-gtk).
3) Mark doesn't have the latest version or there is a patch in CVS for a bug.
4) You want to use the PHP command line interface or need PEAR.
5) You want to install PHP 5
In the future there will be"
6) You want to compile PHP5 with dynamic loading of extensions.
If those aren't an issue, use a precompiled binary froma trusted source. That's the mac way, anyway.
tychay at php dot net