PEAR (PHP Extension and Application Repository) is a bunch of extensions you can install on your server to uitilise clever ‘extras’ that other people have spent their time writing.

To install it, sudo into a terminal console:

$> wget http://pear.php.net/go-pear.phar
$> php go-pear.phar

This should go away and get the files and install it. Now you have to find the extensions you want. They all have an identifier in the form of a string, i.e. Spreadsheet_Excel_Writer – you’re likely to find the name of it on the website that hosts the code/documentation.

Installing it is easy too:

$> pear install Spreadsheet_Writer_Excel

Done. Sometimes, a new version will come out, and the version number will be appended to the end of the name, so you might have to install it like:

$> pear install Spreadsheet_Writer_Excel-09.00.1

But, pear will tell you if this is the case, and it will tell you which version to install.

To list all the PEAR packages on your machine,

$> pear list

To remove one,

$> pear uninstall <packagename>

The place that keeps a list of the locations of the PEAR files is called a channel, and some packages are stored on a different channel to the standard, so you have to add the channel list to PEAR:

$> pear channel-discover <url>

But again, the documentation for the package will tell you if this is the case, and the URL if so.

You can read more about PEAR here – http://pear.php.net/ and there is a list of ‘supported’ packages here – http://pear.php.net/packages.php

 

By admin

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.