If you need to install PHP PDO extensions on Debian Lenny, its very
simple. This is what I did to get it done:

sudo aptitude install php5 php5-dev php5-cli libmysqlclient15-dev

Then use pecl to get PDO:

sudo pecl install pdo

Then, in case you want the PDO MySQL extension:

sudo pecl install pdo_mysql

update: I found out that PDO and mysqli drivers conflicted on my system and I ended up with none. To fix this, do pecl install mysql and then add on your php.ini like indicated below. This enables pdo and mysql driver, but I couldn’t get msyqli driver back on.

Then you have to edit /etc/php5/apache2/php.ini and add:

Also add this line only if you installed pdo_mysql.

Restart your web server with:

sudo invoke-rc.d apache2 restart

And that’s it. Enjoy your PDO extensions on Debian Lenny.

About the author

Gabriel Saldaña Gabriel Saldaña is a web developer, photographer and free software advocate. Connect with him on and Twitter

%d bloggers like this: