Tiger Technologies Technical Support

How do I use and install PEAR packages?

This page is showing a generic answer. To see a more
specific answer, please type your domain name below:

PEAR packages are files that contain prewritten PHP code. Some scripts use PEAR packages to perform tasks such as connecting to a database.

Our Web hosting service supports PEAR, and we have the following "stable" packages installed:

Archive_Tar            HTML_Template_IT        Net_LMTP
Auth_SASL              HTTP                    Net_NNTP
Benchmark              HTTP_Client             Net_POP3
Cache                  HTTP_Request            Net_Ping
Cache_Lite             Log                     Net_Portscan
Console_Getopt         MDB2                    Net_SMTP
Crypt_CBC              Mail                    Net_Sieve
Crypt_CHAP             Math_Integer            Net_SmartIRC
Crypt_HMAC             Net_CheckIP             Net_Socket
Crypt_RC4              Net_Curl                Net_URL
DB                     Net_DNS                 Net_UserAgent_Detect
DB_NestedSet           Net_DNSBL               Net_Whois
Date                   Net_Dict                Numbers_Roman
File                   Net_Dig                 PEAR
File_Find              Net_FTP                 Pager
File_Passwd            Net_Finger              Structures_Graph
File_SearchReplace     Net_Geo                 XML_Parser
HTML_Common            Net_IMAP                XML_RPC
HTML_Form              Net_IPv4                XML_Serializer
HTML_QuickForm         Net_IPv6                XML_Util
HTML_Table             Net_Ident

Other stable packages can usually be installed on request.

Installing other PEAR packages

If you want to install a PEAR package that is not "stable" (that is, a package marked "alpha" or "beta" on the PEAR Web site), you can do so by creating your own PEAR directory.

To do this, you should be comfortable with the command line. Just make a command line connection, then type the following two lines after logging in (you can copy and paste them from here):

pear config-create ~ .pearrc
pear install -o PEAR

This creates a custom PEAR directory located in your home directory.

You can then install your own PEAR modules at any time by typing this:

pear install --alldeps PACKAGE

... where "PACKAGE" is the name of the package, followed by "-alpha" or "-beta".

For example, to install the beta version of the Spreadsheet_Excel_Writer package, you would type:

pear install --alldeps Spreadsheet_Excel_Writer-beta

Setting the version of PHP that Pear uses during package installation

Our control panel allows customers to choose between different versions of PHP for Web pages. However, when you run the "pear" command to install packages, it might choose a different version of PHP. This can cause an error if the package requires a newer version. For example:

package requires PHP (version >= 5.0.0), installed version is 4.3.10-21aaa+tigertech1

You can override this by setting the PHP version before running the "pear" command. For instance, to use PHP 5, run the following command before running any "pear" commands:

export PHP_PEAR_PHP_BIN=/usr/bin/php5

Using custom PEAR packages you install

Once you've installed a package, you'll need to tell your PHP script where to find it. Enter your domain name in the box at the top of this page to see how to do this.

What if I have more questions about PEAR?

The instructions above are based on the PEAR documentation, which has more details and resources for answering questions. You should read the PEAR documentation if you have further questions about PEAR.

Search


Related Topics

PHP Scripts

Unix Shell (telnet and SSH) Access

PHP Versions