As PEAR is not installed by default. To make use of it, you’ll need to install it manually.
These steps describe how to install PEAR in your own home directory.

  • Get the PEAR installer:

  • Run the installer:

  • Adjust settings prior to installing PEAR:

The installer will notice your are running the install as non root, therefore adjusting it’s path. If it doesn’t, please use this configuration:

When this output is printed to the screen, type ‘enter’ to continue or type ‘all’ to set the locations by yourself.

When the PEAR installer asks to alter the php.ini choose: NO

After running the installer, PEAR is installed and you can run it on the command line using /data/web/pear/bin/pear,

Configuring PEAR

To configure PEAR, we generate a .pearrc config file:

This will create a .pearrc in your homedir (/data/web/.pearrc)

Use PEAR on the cli

To make our life easy, let’s add the pear/bin to our path, so we don’t have to type the absolute path to run PEAR:

Now logout and log back into your Hypernode, and you can run PEAR command by just typing pear instead of /data/web/pear/bin/pear

Use PEAR in php

System.php is shipped with every PEAR installation and thus should be on your Hypernode too. Therefore we’ll use it to test whether PEAR is working.
To use it, we must add our PEAR lib directory to the PHP include path, so PHP is able to find the libraries.

  • Create a script in /data/web/public/peartest.php with the following content:

Now if you run the script on the commandline or through your browser, a boolean should be returned, returning True when OK.

  • Installing PEAR packages

Install a package by running:

Which should give you the following output:

  • Adjust php include_path to use PEAR in your shop

To use PEAR packages in your application, you should adjust the include path in your PHP script:

20