Use Pre-built PHP Modules Efficiently

PEAR (PHP Extension and Application Repository) is a structured archive for reusable PHP components. Instead of writing complex functions for email delivery, XML processing, or database queries yourself, you can draw from thousands of verified open-source packages and install them with just a few clicks.

Benefit for Developers: PEAR packages massively accelerate development. You simply integrate the installed code into your script using an include statement.

Finding and Installing PEAR Packages

You have three ways to add new functions to your hosting account:

  • Direct Installation: If you already know the name of the package, enter it above and click "Install Now".
  • Search: Use the search field to look for keywords like "Mail", "Date", or "XML".
  • Browse Catalog: Click on "Show Available PHP Extensions and Applications Packages" to view the full list of available modules.

Integration into Your Code (Include Path)

For your PHP scripts to know where the installed packages are located, you need to know the correct Include Path. You can find this in cPanel at the very top in the "Module Search Path" section.

A typical example for integration into your PHP script:

set_include_path('/home/youruser/php' . PATH_SEPARATOR . get_include_path());
require_once 'PEAR/Package_Name.php';

Managing Installed Modules

In the "Installed PHP Extensions and Applications Packages" table, you can manage your modules:

Action Meaning
Update Brings the package to the latest available version.
Reinstall Useful if files have been corrupted.
Uninstall Removes the package from your user directory.
System Modules: Certain packages are already pre-installed ("System Installed Modules"). These can be used by you, but cannot be deleted or modified as they are necessary for server operation.

Are you looking for a more modern alternative for PHP projects?
Ask our support about using Composer via SSH.

Was this answer helpful? 0 Users Found This Useful (0 Votes)