You would be best off just compiling your own custom versions rather than trying to overwrite the versions that come built into Mac OS X. At least that way you'll be able to specify exactly what you want to be available in your PHP binaries (including database support for MySQL and / or PostgreSQL) which is not available in the Apple supplied ones.