I have to do this so often I decided to just put it on my site.
Apple didn’t include MySQL support for PDO within Mac OS X 10.5 (Leopard), much to the frustration of many PHP + Mac devs.
I’ve built pdo_mysql.so for Mac OS X using the 5.2.6 source and latest mysql source.
pdo_mysql.so (133kb MD5: 9f2d8b843a2031907a994ec62e7d2c45)
This works on my xserve, and desktop mac machines running 10.5.5 with the stock PHP 5.2.6 and MySQL 5.0.67 (i686) and 5.0.45 (powerpc).
Just place the file in /usr/lib/php/extensions/no-debug-non-zts-20060613/pdo_mysql.so and add extension=pdo_mysql.so to your /etc/php.ini file.
This should work on all the following architectures:
ucommbieber:no-debug-non-zts-20060613 bbieber$ file pdo_mysql.so pdo_mysql.so: Mach-O universal binary with 4 architectures pdo_mysql.so (for architecture i386): Mach-O bundle i386 pdo_mysql.so (for architecture x86_64): Mach-O 64-bit bundle x86_64 pdo_mysql.so (for architecture ppc7400): Mach-O bundle ppc pdo_mysql.so (for architecture ppc64): Mach-O 64-bit bundle ppc64
Here’s the address to download the extension http://saltybeagle.com/downloads/pdo_mysql.so
If you’d like the full details to build the extension yourself – see Tom Gidden’s post with all the info.