Pear Package Management for PHP

Source: Internet
Author: User
Tags pear php website

1. Installation:
$ sudo wget http://pear.php.net/go-pear.phar
$ sudo php go-pear.har


2. Check the packages installed under Pear:
$ pear List


3. Check the installation path of the pear package
Under Linux: Php-c/etc/php5/apachr2/php.ini-r ' Echoget_include_path (); ' You can display the directory where the installed packages are located. The default installation path is below/usr/share/php/pear/


4. Using Pear Bag
Add Requore_once "pear.php" to the file you want to use;


5, pear more package installation
Pear Install PackageName


Example: Pear Install DB
Tip: In the https://pear.php.net/packages.php website you can view pear owned packages, direct access to the display is categorized, install a need to click on the link to enter. For example: Install file under File System, command pear Install file

-------------------------------------

You can find the Pear.bat file in your PHP root directory, which is the Management pear command used in CMD to set the environment variable path.

The following command operates under a DOS window (please change the packegename to use the package)

1, Pear packagename Install a new pear package, such as the installation of DB operation is d:/php/pear Pear db

2, download but do not install: Pear Download PackageName

Pear Download-all

3, Pear website website All can get the Pear Library list:

Pear remote-list

4. List installed package:

Pear List

5, List can upgrade package:

Pear List-upgrades

6. Update (upgrade):

Pear Upgrade PackageName

Pear Upgrade-all

To remove an installed package:

Pear un packagename

---------------------------------------

Here's a simple form creation example to tell.

First install the Html_quickform package

The way of thinking is as follows:

Pear Install Html_quickform

Kaneyasu good, can write code:

<?PHPrequire_once("html/quickform.php");//first introduce this pear package$form= Html_quickform (' formtest ', ' post ');//Create a Form object$form->addelement (' header ', ' header ', ' login page ');//Setting page Information$form->addelement (' text ', ' user_name ', ' User name: ');//Set User login input Box$form->addelement (' Password ', ' user_password ', ' Password: ');//Set User Password$form->addelement (' Submit ', ' submission ', ' submissions ');//Set Submit button$form->display ();//output The setting information to the browser?>

Pear Package Management for PHP

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.