Pear Installation
In Linux, as long as you install PHP 4.3.0 or later, the default installation supports pear, unless you use the "-- without-Pear" option to modify PHP. INI file, add the pear package directory in the include_path Section to ensure that the file can be found using include in PHP. /Bin/pear under the PHP Directory. You can use it to manage the pear package in the future.
PHP installed in windows, there are two directories under the PHP installation directory CLI and Pear there is a file GO-PEAR.BAT
Run the GO-PEAR.BAT under the PHP Directory, it will install pear Command for you and install some pear packages
Enter the HTTP proxy service. If there is no proxy server, press Enter.
Press enter if the current path is correct by default. If you want to modify the path, press Enter.
It is prompted that the following packages will be bundled with PHP. Select y
Prompt to use local package, prompt to install successfully
If the include_path entry is not found in PHP. ini, a problem occurs when you use pear, prompting whether to modify PHP. ini. Answer Y, prompting you to modify PHP. ini.
Press enter. After installation, pear. bat is created in the PHP Directory. You can use it to manage the pear package.
Pear package management (in Linux, pear. bat is used in pear windows. The following uses pear in Linux as an example)
Installation:
Pear install packagename
Download packages but not install:
Pear download packagename
Pear download-all
Install the downloaded package:
Pear install filename. tgz
Pear website package list:
Pear remote-list
List of locally installed packages:
Pear list
List the packages that can be upgraded:
Pear list-upgrades
Update package:
Pear upgrade packagename
Pear upgrade-all
Delete the installed package:
Pear uninstall packagename
Pear package usage
First install pear install html_quickform. The HTML directory is created under PHP/lib/PHP/and some files are generated in the HTML directory.
<?
/*
If the include file cannot find the pear package, set include_path.
// PhP4
Ini_set ('include _ path', ini_get ('include _ path'). "Pear package installation path ");
// PhP5
Set_include_path (get_include_path (). 'pear package installation path ');
*/
Require_once 'html/quickform. php ';
// Create a form object
$ Form = new html_quickform ('test', 'post ');
$ Form-> addelement ('text', 'name', 'username: ', array ('SIZE' => 30, 'maxlength' => 25 ));
$ Form-> addelement ('submit ', 'submit', 'Submit ');
// Output to the browser
$ Form-> display ();
?>
Reference announcement address:Http://www.longtengit.cn/blog/trackback.php? Tbid = 48 & extra = 7859a9