Php – getting PHP PDO flavors to work on Mac OS X

mac-osxpdoPHP

I'm running OS X 10.5; it looks like it came with Apache and PHP installed (minus some minor configurations which I turned on per this page; I've used Apache before so I know the basics of how httpd.conf works).

I've got a pre-existing script which uses PDO. I've got a MySQL database and can easily configure my script to access the database via PDO MySQL or PDO ODBC. The problem is, that even though I enabled the PDO MySQL and PDO ODBC extensions in php.ini, phpinfo() reports the only PDO drivers are sqlite2 and sqlite. I'm guessing the relevant extension .dll or .so files are not present? How do I get them?

note: I'm using the built-in install for PHP. (see apple's page on enabling php, which doesn't say anything about configure or adding additional .so files)

Best Answer

The default PHP install is not very useful. The easiest way to get more feature-complete versions of standard unix packages for OSX is to use either MacPorts or Fink. I personally prefer MacPorts, although I think most folks prefer Fink.