How to enable PDO_MYSQL in 5.2.4 PHP included into Leopard

I get it all working but getting an error:
uncaught exception 'PDOException' with message 'could not find driver'.

It looks like there is no PDO-MYSQL in phpinfo configuration list.

On dreamhost (and on my old tiger):
PDO support enabled
PDO drivers sqlite2, sqlite, mysql

pdo_mysql
PDO Driver for MySQL, client library version 5.0.16

on Leopard:
PDO
PDO support enabled
PDO drivers sqlite2, sqlite

Thanks,
V.

Mac OS X (10.5)

Posted on Oct 28, 2007 7:57 AM

Reply
17 replies

Apr 8, 2009 11:57 AM in response to ValGor

I ran into this one also.
Here's how I solved it (on two computers)

I started with clean installs of Leopard.

1. Make sure you've got the developer tools installed. I don't know why they're important but they seem to be.
2. Download and install one of the packages from www.entropy.ch (I installed Entropy PHP 5.2.9-7)
3. If you haven't already installed MySQL do that.

I don't like the why Leopard handles virtual hosts, so I've started using VirtualHostX. (it's $9.00)

I set up a dev site (test.dev) and pointed it at the folder I wanted to use, created a phpinfo(); page and all the bits and pieces that I need, especially PDO_MySQL is there, intact and working.

A couple notes.
* Make sure you read the postings at entropy.ch that are in the same thread as the package that you download. Mark (who runs entropy.ch) is incredibly generous and helpful.
* Currently the CLI for PHP is broken. I don't know why. That's what I'll fix next.
* Don't bother asking Apple (I did). They're great people, but singularly not helpful with this problem. They can't even tell me who's great idea it was to disable PDO_MySQL in stock Apple installation of PHP.

Hope this helps.
C

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How to enable PDO_MYSQL in 5.2.4 PHP included into Leopard

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.