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