PHP on Ubuntu Gutsy Gibbon with PDO and PDO_mysql

A (very) quick tutorial on setting up mysql PDO libraries for PHP on ubuntu Gutsy Gibbon.

This version of PHP is the default one that comes with this version, 5.2.3. Check you have installed the php5-common package from aptitude as this includes the pdo.so file. If you check phpinfo you should see that PDO is listed as a module although you don’t have any drivers.

Then you should do:

sudo aptitude install php5-mysql

Restart apache and check its error log in case there are any problems. Then simply refresh your phpinfo page and pdo_mysql should be listed.

For earlier versions of ubuntu/kubuntu have a look at this excellent tutorial from theatons, I followed this but its slightly out of date now which is why I’ve posted an update. Most of the rest of the tutorial is still correct though.

Leave a Reply

Please use [code] and [/code] around any source code you wish to share.

This site uses Akismet to reduce spam. Learn how your comment data is processed.