Error: "PEAR: command not found"

<!–

Error: “PEAR: command not found”

–>

The error
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.

The resolution
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.

Posted in: News | Tagged: