Wed Mar 16 20:44:46 EET 2011

How to fix php "Uncaught exception 'PDOException' with message 'could not find driver'" on FreeBSD

After some upgrades of PHP, My Less'n More URL suddenly stopped working with an error:

Uncaught exception 'PDOException' with message 'could not find driver'


After a bit of investigation I've figured out the error is caused by a missing php5-pdo and php5-pdo_mysql

Of course if you're using php52 you will need to install respectively the ports php52-pdo and php5-pdo_mysql :

To resolve the issues issue the commands:

freebsd# cd /usr/ports/databases/php5-pdo
freebsd# make install clean
freebsd# cd /usr/ports/databases/php5-pdo_mysql