How to install a PHP-Pear package

Posted by Joys of Programming on in PHP, Ubuntu

To work with pear packages, you must first install Php-pear. Once installed, you must find the source of the package to be installed.

The general syntax of installing a pear package

$ pear install package_source

Example. I want to install Auth pear package. I will write

$ pear install pear.php.net/Auth
WARNING: configuration download directory "/build/buildd/php5-5.3.2/pear-build-download" is not writeable.  Change download_dir config variable to a writeable dir to avoid this warning
Cannot install, php_dir for channel "pear.php.net" is not writeable by the current user

You can see some permission issues. You must be admin to install these packages or have sudo access

$ sudo pear install pear.php.net/Auth
WARNING: "pear/DB" is deprecated in favor of "pear/MDB2"
WARNING: "pear/MDB" is deprecated in favor of "pear/MDB2"
Did not download optional dependencies: pear/Log, pear/File_Passwd, pear/Net_POP3, pear/DB, pear/MDB, pear/MDB2, pear/Auth_RADIUS, pear/Crypt_CHAP, pear/File_SMBPasswd, pear/HTTP_Client, pear/SOAP, pear/Net_Vpopmaild, pecl/vpopmail, pecl/kadm5, use --alldeps to download automatically
pear/Auth can optionally use package "pear/Log" (version >= 1.9.10)
pear/Auth can optionally use package "pear/File_Passwd" (version >= 1.1.0)
pear/Auth can optionally use package "pear/Net_POP3" (version >= 1.3.0)
pear/Auth can optionally use package "pear/DB" (version >= 1.6.0)
pear/Auth can optionally use package "pear/MDB"
pear/Auth can optionally use package "pear/MDB2" (version >= 2.0.0RC1)
pear/Auth can optionally use package "pear/Auth_RADIUS"
pear/Auth can optionally use package "pear/Crypt_CHAP" (version >= 1.0.0)
pear/Auth can optionally use package "pear/File_SMBPasswd" (version >= 1.0.0)
pear/Auth can optionally use package "pear/HTTP_Client" (version >= 1.1.0)
pear/Auth can optionally use package "pear/SOAP" (version >= 0.9.0)
pear/Auth can optionally use package "pear/Net_Vpopmaild" (version >= 0.1.0)
pear/Auth can optionally use package "pecl/vpopmail" (version >= 0.2)
pear/Auth can optionally use package "pecl/kadm5" (version >= 0.2.3)
pear/Auth can optionally use PHP extension "imap"
pear/Auth can optionally use PHP extension "saprfc"
downloading Auth-1.6.2.tgz ...
Starting to download Auth-1.6.2.tgz (56,036 bytes)
.............done: 56,036 bytes
install ok: channel://pear.php.net/Auth-1.6.2

You can see how the package is successfully installed

Tags: , ,

Comments:

1 Comment

  • Brad Bahmanpour says:

    Great Help!

    Thanks

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>

Copyright © 2009-2012 Joys of Programming All rights reserved.
Desk Mess Mirrored v1.8.1 theme from BuyNowShop.com.