# Installing PHP PEAR packages using cPanel

> Find, install and remove PHP PEAR packages from cPanel and include them in your PHP scripts.

Source: https://helpcenter.ruachost.com/cpanel/software/installing-php-pear-packages-using-cpanel/

**PEAR (PHP Extension and Application Repository)** packages are reusable PHP code libraries that simplify web development. With cPanel, you can install and manage PEAR packages directly from your hosting account without needing manual server configuration.

## Why Use PEAR Packages?

- Speed up development with pre‑built PHP libraries.
- Add functionality such as XML parsing, database access, or caching.
- Manage packages easily through cPanel’s interface.

## Steps to Install a PEAR Package

### 1. Access the PEAR Installer

1. **Log in to cPanel.**
2. On the **Tools page → Software section**, click **PHP PEAR Packages**.
3. The **PHP Extensions and Applications Package Installer** page appears.

   - Note the path where PEAR packages are installed — you’ll need this for updating your PHP include path.

### 2. Install a Package

You can install PEAR packages in several ways:

- ### Search for a package

  1. Type the package name (e.g., `XML`) in the search box.
  2. Click **Go**.
  3. Scroll down and click **Install** next to the desired package.
- ### Browse available modules

  1. Click **Show Available Modules**.
  2. Scroll through the list and click **Install** for the package you want.
- ### Install by name

  1. Under **Install a PHP Extensions and Applications Package**, type the exact package name.
  2. Click **Install Now**.

### 3. Manage Installed Packages

- After installation, packages appear under **Installed PHP Extension(s) and Application(s)**.
- Options available:

  - **Update** → Upgrade to the latest version.
  - **Reinstall** → Reinstall the package if needed.
  - **Uninstall** → Remove the package.
  - **Show Docs** → View documentation for the package.
  - **Show System Installed Modules** → See packages installed system‑wide.

### 4. Configure PHP Include Path

After installing a PEAR package, you must configure the **PHP include path** so your application can use it.

- Add the path provided by cPanel to your PHP scripts.
- Example:

  ```
  ini_set("include_path", "/home/username/php");
  ```

##

> **Note:**
- PEAR packages are installed per account, not globally.
- Always update packages to benefit from security patches and improvements.
- Incorrect include paths may cause errors when using PEAR libraries.

##
