Using PECL with Ubuntu

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.
Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • Slashdot
  • Facebook
  • TwitThis
  • Google
  • Live
  • YahooMyWeb
  • del.icio.us
  • StumbleUpon
  • Technorati

3 Comments so far »

  1. Ian said,

    Wrote on March 27, 2007 @ 3:00 pm

    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 said,

    Wrote on December 15, 2007 @ 5:47 pm

    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 said,

    Wrote on December 22, 2007 @ 7:53 pm

    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.

Comment RSS · TrackBack URI

Leave a Comment

You must be logged in to post a comment.