Home Guides Glossary

Installing PEAR on Linux Web Hosting

The file PEAR provides (go-pear.php) currently has a bug that prevents its default implementation from working. We have steps to correct it outlined in this article, but it requires manually modifying the default code. We provide this information as a courtesy and neither guarantee nor support its operation.

PEAR is a structured library of open-source code for users of PHP. The installation requires a specialized file named go-pear.php, which is a modification of your php5.ini file. You also need to password protect the directory you create for the PEAR admin.

To Install PEAR on Linux Web Hosting

  1. Go to http://pear.php.net/go-pear.
  2. Copy the script on the page, and then paste it into a new text document.
  3. Save the new file as go-pear.php.
  4. In a text editor, replace lines 115 through 120 with the following code:
    $bootstrap_files = array(
    'PEAR5.php'            => 'https://raw.githubusercontent.com/pear/pear-core/master/PEAR5.php',
    'PEAR.php'             => 'https://raw.githubusercontent.com/pear/pear-core/master/PEAR.php',
    'Archive/Tar.php'      => 'https://raw.githubusercontent.com/pear/Archive_Tar/master/Archive/Tar.php',
    'Console/Getopt.php'   => 'https://raw.githubusercontent.com/pear/Console_Getopt/trunk/Console/Getopt.php',
    );
  5. Upload the file to the root level of your hosting account.
  6. Using an Internet browser, locate the file. For example, go to http://coolexample.com/go-pear.php, where coolexample.com is your domain name.
  7. Follow the displayed instructions.

    This installer creates an index.php in the root and overwrites any existing index.php files. To avoid accidental overwrite, you can temporarily rename the current index.php before running the go-pear.php script.

  8. Once the installation completes, update the php5.ini file with include_path. Which path you use depends on your account's PHP version (more info).

    PHP 5.3:
    .:/usr/local/php5_3/lib/php:/[absolutepath]/PEAR
    Other PHP versions:
    .:/usr/local/php5/lib/php:/[absolutepath]/PEAR
    where [absolutepath] is your account's absolute path. For more information, see Find your absolute path.
  9. Create a directory for the PEAR admin, and then password protect it. For more information, see Password Protecting a Directory in Your Shared Hosting Account
  10. Move the index.php that the PEAR installer created to the new directory. The directory is the path for your PEAR admin.

After installing PEAR, you can install modules by going to the PEAR admin at coolexample.com/pearadmin, where coolexample.com is your domain name.

Domain Registration

Pay less for website domain names. Register your own .com, .net or .org for as low as $10.18 per year. We have everything you need to get online with your new domain.

Website Builder

Build an amazing website in just under an hour with Website Builder. Take advantage of designs created just for your industry and then customize them to reflect your one-of-a-kind idea.

Website Security

Protect your website and keep customers safe. Your comprehensive Website Security solution. Get peace of mind by securing your websites.

cPanel Hosting

Everything needed to give your website the high-performance home it deserves.  Protect transactions and secure your customer's data with a SSL Certificate
Copyright © 2005 - 2024.  All rights reserved.  Privacy Policy