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.

At this time, is down, so the normal install commands do not function.

To install packages, you must download them manually to your server. Visit the following article for instructions.

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 DreamHost home directory, e.g., '/home/user'.

See also

Did this article answer your questions?

Article last updated PST.