Troubleshooting PEAR errors


This guide assumes you've already installed PEAR using the following guide:

It’s possible your PHP site will throw an error if certain PEAR packages are not installed. For example, if you get an error referencing any of the following, run the command below (in your user's directory) to install that package.

Error reference Command to fix
[server]$ pear install --alldeps Mail
[server]$ pear install --alldeps Mail_Mime
[server]$ pear install --alldeps Console_Getopt
[server]$ pear install --alldeps MDB2
[server]$ pear install --alldeps Net_SMTP

Script errors

When you create a script that references PEAR, make sure to add these two lines at the very top of that script:

error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED ^ E_STRICT);
set_include_path("." . PATH_SEPARATOR . ($UserDir = dirname($_SERVER['DOCUMENT_ROOT'])) . "/pear/php" . PATH_SEPARATOR . get_include_path());
  • The first line turns off any errors that may show.
  • The second line allows the script to reference your PEAR installation.

Additionally, you may need to include the configuration file that you created. The configuration file includes variables for template and data path, which are required for some PEAR modules:

$pear_user_config = $UserDir . "/.pearrc";

Where $UserDir = dirname($_SERVER['DOCUMENT_ROOT']) dynamically determines your user's home directory, e.g., /home/username.

Installation error

You may see the following error after attempting to install a package:

[server]$ pear install --onlyreqdeps Mail
No releases available for package ""
install failed

To fix this error, view the following article:

If that doesn't work, try updating channels and upgrading. This will display if there are any errors connecting to For example:

[server]$ pear update-channels
Updating channel ""
Update of Channel "" succeeded
Updating channel ""
Channel "" is not responding over http://, failed with message: Connection to `ssl://' failed:
Trying channel "" over https:// instead
Cannot retrieve channel.xml for channel "" (Connection to `ssl://' failed: )
Updating channel ""
Update of Channel "" succeeded

[server]$ pear upgrade
Error getting channel info from Connection to `ssl://' failed:

In this case it's an issue with the website that needs to be resolved on their end.

See also

Did this article answer your questions?

Article last updated PST.

Still not finding what you're looking for?