Installing and Updating PEAR

Source: Internet
Author: User
Tags pear hosting shared hosting shared hosting provider
pear:php Extension and Application Repository, is one of the most effective means for finding and resuing great PHP code.

It has been included with the distribution since version 4.3.0. If you are running PHP 4.2.X or an earlier version, this section will teach you how to install PEAR Package Manager. Because many readers run a Web site on a shared hosting provider, this section also explains how to leverage PEAR without running Package Manager.

1, installation PEAR

1.1. Install PEAR on Linux

Installing Pear on Linux is simple because, since PHP 4.3.0, it is installed by default, except when you configure PHP

The--without-pear option to explicitly disable its installation. If you do disable it, make sure that you do not take it when you reconfigure PHP

The--without-pear option is available, and another option is to display the plus--with-pear options.

There is another way to install it: Download a script from pear.php.net and then execute the script with PHP binary. Open a terminal and enter the following command:%> Lynx-source http://pear.php.net/go-pear | Php

Note that you need to have the Lynx Web browser installed. However, you can also use a standard browser such as Firefox to browse the URL to save it, and then use PHP binary to execute it.

Once the installation process has started, you will be prompted to confirm some of the configurations, such as where to store PEAR packages and documents. You are likely to accept the default answer. After a few questions, you will also be prompted to install 3 optional packages, which can only be installed on either a full installation or one, so if you want to start using these packages immediately, agree.

1.2. Install PEAR on Windows

Windows distribution does not have PEAR installed by default. To install it, you will need to run PHP distribution under the root directory of the

Go-pear.bat file. The file installs the Pear command, the necessary supporting files, and the 6 pear packages mentioned earlier. Go to that directory and execute%>go-pear.bat or php go-pear.phar

2, PEAR and hosting company

Due to the extensive use of PHP in a managed environment, it is likely that your provider will at least allow access to a system-wide pear installation. However, if you can access the hosting server from the command line, you can easily configure a local version with the following command:%>pear config-create/home/username/pear. PEARRC

You need to replace the above username with the user name in your server environment (which may also include the path). Then, open your. bashrc file to add the path ~pear/bin to path so that you can invoke the locally installed Pear command. Finally, execute the following command to create a directory structure to hold your pear package:

%>pear Install-o Pear

From now on, you can use the Pear command to install the package, and the packages will be stored under your local account. Just remember to use these packages and you need to modify the PHP include_path directive to point to your/home/username/pear/lib directory.

3. Update PEAR

Although it has been around for more than 10 years, the Pear Package Manager is constantly improving. Therefore, you will want to check for updates occasionally.

%>pear Upgrade

The above describes the installing and Updating PEAR, including the aspects of the content, I hope that the PHP tutorial interested in a friend helpful.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.