Archive for the tag 'PEAR'

SBDavid

Error: “PEAR: command not found”

Error: “PEAR: command not found”

If you build PHP with PEAR, and the script pear does not exist on your server, this is what happened:

At some point, /usr/local/bin/pear and/or /usr/bin/pear were manually removed.

The directories /usr/local/lib/php/.registry and/or /usr/lib/php/.registry exist.

During PHP’s make install, the existence of those .registry directories cause the PEAR shell archive to think PEAR is already installed, so it skips the remainder of the PEAR build. Therefore, the bin/ files are not rebuilt.

However, if you move or delete the .registry files so that the build will complete, you lose the data about PEAR modules installed on the system.

How to resolve this issue.

The best course of action is to download the PEAR tarball from http://pear.php.net/package/PEAR/download to obtain the bin/ that is missing on your server, and place it in the proper location on your system.

Reference : http://cpanel.net & http://pear.php.net/

Installing the PEAR package manager and Checking if PEAR works

When using PHP >= 4.3.0, the PEAR Package Manager is already installed unless one has used the ./configure option –without-pear.

Verifying command line tool

Both pear and pecl tools should be available everywhere on command line. For that to work, pear’s binary (bin) directory should be in your PATH variable.

# apt-cache search php-pear
php-xml-util – a XML utility for php-pear
php-pear – PEAR – PHP Extension and Application Repository

To verify it works, simply type pear. A list of commands should be shown:

root@laptop:~# pear
Commands:
build Build an Extension From C Source
bundle Unpacks a Pecl Package
channel-add Add a Channel

You should further test that PEAR is up to date:

root@laptop:~# pear version
PEAR Version: 1.7.1
PHP Version: 5.2.6-3ubuntu4.5
Zend Engine Version: 2.2.0