Posts Tagged ‘How to fix php “Uncaught exception ‘PDOException’ with message ‘could not find driver'” on FreeBSD’

How to fix php “Uncaught exception ‘PDOException’ with message ‘could not find driver'” on FreeBSD

Wednesday, March 16th, 2011

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
freebsd# make install clean