How to install PHP PDO extensions on Debian Lenny

php 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 extension=mysql.so 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:

extension=pdo.so

Also add this line only if you installed pdo_mysql.

extension=pdo_mysql.so

Restart your web server with:

sudo invoke-rc.d apache2 restart

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

Related posts:

  1. Debian Lenny on Dell XPS m1530
  2. How to install latest Git on Ubuntu
  3. Debian and the girlfriend
  4. PHP syntax check as you type with Emacs
  5. Happy 17th birthday Debian

About Gabriel Saldaña

Web developer and free software advocate.
This entry was posted in GNU/Linux Free Software & Open Source, Programming & Web Development and tagged , , , , , , . Bookmark the permalink.

5 Responses to How to install PHP PDO extensions on Debian Lenny

  1. sokai says:

    Thanks for that hint but I found out that pdo.so and pdo_mysql.so are available in the lenny packages php-common and php5-mysql. – I think it’s easier to install and update the core packages than using pecl. sofar|sokai

  2. sokai says:

    damn …the package name for pdo.so is not “php-common” but php5-common! sry

  3. bmau says:

    You also need package libmysqlclient-dev if you want to install with pecl: apt-get install libmysqlclient-dev

    but much easier is to install as sokai pointed.

  4. Pavel zby-cz says:

    Hi, I had problem in Debian Lenny saying “pecl.php.net is using a unsupported protocal – This should never happen. install failed”

    The solution is to delete /usr/share/php/.channels directory and run “pecl update-channels”

  5. Pingback: vServer PHP Erweiterungen installieren - Server Support Forum

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>