# Install PEAR packages
Source: https://docs.webgee.com/en/development/how-to-install-pear



Install PEAR packages on your hosting account. Applies to shared, reseller and
Premium hosting.

<Callout type="info">
  **PEAR is largely obsolete.** It has been superseded by
  [Composer](https://getcomposer.org/), which nearly all modern PHP libraries use
  and which resolves dependencies per project rather than per account. Use PEAR
  only for a legacy application that specifically requires it.
</Callout>

## Through cPanel [#through-cpanel]

1. In cPanel, open **PHP PEAR Packages** under **Software**.
2. Search for the package.
3. Select **Install**.

Packages install into your home directory, and cPanel shows the `include_path`
your scripts need.

## Add the include path [#add-the-include-path]

PEAR packages are not found automatically. Either set it per script:

```php
<?php
set_include_path('/home/cpaneluser/php:' . get_include_path());
require_once 'Package.php';
```

Or account-wide, in **Select PHP Version → Options**, by setting
`include_path` — see
[Change your PHP version and settings](/en/development/change-php-version).

The exact path is shown on the PHP PEAR Packages page. It differs by account, so
use the one displayed rather than the example above.

## Use Composer instead where you can [#use-composer-instead-where-you-can]

Composer is available over SSH and is the right tool for anything new:

```bash
cd ~/public_html
php -d allow_url_fopen=1 /usr/local/bin/composer require vendor/package
```

Dependencies install into `vendor/` inside your project, with an autoloader —
no `include_path` to configure, and no risk of one application's requirements
conflicting with another's.

## If a package will not install [#if-a-package-will-not-install]

* **It requires a PHP extension that is not enabled.** Check under
  **Select PHP Version → Extensions**.
* **It needs compilation.** Packages requiring a compiler cannot be installed on
  shared hosting. A [VPS](/en/servers/cloud-server-quick-start) can.
* **It is abandoned.** Many PEAR packages have not been updated in a decade.
  Check for a Composer equivalent first.

## Related [#related]

* [Change your PHP version and settings](/en/development/change-php-version)
* [Connect over SSH](/en/development/connect-via-ssh)
