Using the Pear Package Manager

Source: Internet
Author: User
Tags pear
With the Pear Package Manager, you can browse and search for the packages you've contributed, view the latest releases, and download the packages. The syntax for executing it on the command line is as follows:%>pear [options] command [command-options]

Open a command-line prompt, execute%>pear, and output a set of common commands and some usage information.

%>pear Help can query the use of a command.

1. View the installed PEAR package

%>pear List

2. Learn more about the installed PEAR pack

%>pear Info Package Name

3. Install PEAR Package

Syntax:%>pear install [options] Package

Suppose, for example, that you want to install a Auth package:%>pear Install Auth

From the execution output of the command, you can see that many packages have optional dependency packages, and if they are installed, some of the available features can be extended.

3.1, automatic installation of all dependent

Any required dependencies will be installed by default after the pear version. However, you may also want to install optional dependencies. This time, pass-A is the--alldeps option:

%>pear install-a Auth_http

3.2. Manually install a package from PEAR Web Site

The Pear Package Manager installs the latest stable version of the package by default. But if you want to install a previous version of the package, or you can't use the Package Manager at all (because there are some administrative restrictions on the shared server), you can go to pear.php.net and find the package you need. If you know the package name, add the package name directly behind the URL just now, so that's a shortcut. These packages are formatted as tgz.

Then, extract the downloaded tgz format file to the appropriate location. Creating a pear directory in the home directory is sufficient if you are forced to follow the installation process by bypassing the ISP restrictions. In any case, make sure that the directory is in Include_path.

4. Include the package into the script

Using the pear package is simple, just use include or require to make the contents of the package available to the script. Remember that you need to add the base directory of the pear to the include_path directive.

Require_once ("numbers/roman.php")

The above describes the use of the Pear Package Manager, including 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.