Rich Buggy

...Developer, CTO, Entrepreneur

Using PECL with Ubuntu

Written by Rich on March 9th, 2007

PECL is a repository for PHP extensions. It’s where old extensions go to die and new extensions are developed. In a previous post I gave the commands to install PDO from PECL but forgot to mention that before you can install anything from PECL you need to install the php5-dev package first.

% sudo apt-get install php5-dev

You need to install the dev package because PECL extensions are compiled into PHP. This should tell you two important things:

  1. Be very careful when deciding which extensions to include. While an unstable PEAR package might cause your application to fail a bad PECL extension can cause your web server to crash.
  2. When you upgrade PHP you will probably need to reinstall the PECL extension.

3 Comments so far ↓

  1. Ian says:

    I just tried to install PECL as per above and it didn’t install.

    I did end up getting it by installing PEAR.

    Cheers,

    Ian

  2. smiley says:

    4.

    how about in pgsql? I am using pgsql for my database. I had installed pdo using pecl, then I added extension=pdo.so in my php.ini.When I restart my apache and browse my localhost there is a
    Fatal error: Class ‘PDO’ not found in /var/www/repos/php_iTranscribe-admin/db.inc on line 21
    displayed in my browser.

    Anybody help me to solve this..

    Version of my ubuntu is 6.10
    php is 5.1.6
    apache 2

    Thank you in advance.

    cheers,
    Smiley

  3. Rich says:

    PDO isn’t enabled by default in PHP 5.1. I’d recommend upgrading to a more recent version of Ubuntu. If you can’t do that then follow the instructions at http://www.buggy.id.au/2007/02/19/installing-pdo-on-ubuntu but compile the pgsql driver instead of the mysql driver.

You must be logged in to post a comment.