Pear is a PHP extension and application library. It contains many useful classes. After php5.0 is installed, pear is not actually installed. The installation method is as follows:
1. Double-click the go-pear.bat in the php Directory.
2. enter some settings as prompted. Add the LAN gateway, for example, http: // 192.168.0.1: 80/. pear needs to use this address to access the Internet. If there is no proxy server, press Enter.
3. You will be prompted to bind some packages to PHP and select Y.
4. Install the basic package and prompt that the installation is successful.
5. Open the php. ini file in the windows directory and find the following:
; UNIX: "/path1:/path2"
; Include_path = ".:/php/shortdes"
; Windows: "\ path1; \ path2"
; Include_path = ".; c: \ php \ shortdes"
Remove the comment from the last line and change the following path to your PEAR path, for example:
Export de_path = ".; c: \ php \ pear \"
Save PHP. INI and restart APACHE.
---------------
Pear Command help
---------------
You can find the pear. php file in your PEAR directory. This is the command for managing pear, which is used in CMD. Some of its command functions are as follows:
Security Protection:
A pear program running on the Web server:
Pear install packagename
The following packages are not supported:
Pear download packagename
Pear download-all
The package of the specified region is as follows:
Pear install filename. tgz
List:
Currently, all pear program regions can be obtained on the pear Website:
Pear remote-list
List Installed packages:
Pear list
List packages that can be upgraded:
Pear list-upgrades
Update (upgrade ):
Update package:
Pear upgrade packagename
Pear upgrade-all
Remove:
Remove the installed package:
Pear uninstall packagename
----------------
Install a new package
----------------
For example, you downloaded the new package xxx.tgzfrom http://pear.php.net/package.
Copy it to the C: \ PHP \ PEAR \ go-pear-bundle directory and enter:
Pear install xxx. tgz
Then, extract the related files to the directory C: \ PHP \ PEAR.
---------------
Instance
---------------
Download the PEAR: HTML_Common and PEAR: HTML_QuickForm packages and install them.
Create a new PHP file and enter the code
<! Doctype html public "-// W3C // dtd html 4.0 Transitional // EN">
<HTML>
<HEAD>
<TITLE> PEAR: HTML_QuickForm </TITLE>
<Meta name = "Generator" CONTENT = "EditPlus">
<Meta name = "Author" CONTENT = "Haohappy">
</HEAD>
<BODY>
<?
Require_once ("HTML \ QuickForm. php ");
// Create a form object
$ Form = new HTML_QuickForm ('frmtest', 'post ');
$ Form-> addElement ('header', 'header', 'login ');
$ Form-> addElement ('text', 'name', 'username :');
$ Form-> addElement ('Password', 'Password', 'Password :');
$ Form-> addElement ('submit ', 'submit', 'Submit ');
// Output to the browser
$ Form-> display ();
?>
</BODY>
</HTML>