PHP 5.0 Pear installation Method _php Tips

Source: Internet
Author: User
Tags pear
Pear is a php extension and application library that contains a number of useful classes, and after installing php5.0, pear is not actually installed, and the installation method is as follows:
1. Double-click Go-pear.bat in the PHP directory.
2. Follow the prompts to enter a number of settings information, mainly to the LAN gateway Plus, such as http://192.168.0.1:80/, pear to use this address to access the Internet, if no proxy server then direct return
3. Then you will be prompted with some packages and PHP bindings, select Y.
4. Then install the basic package and prompt installation success, it is so simple.
5. Open the php.ini file in the Windows directory, and then find the following places:
; UNIX: "/path1:/path2"
; include_path = ".:/ Php/includes "

; Windows: "\path1;\path2"
; include_path = ".; C:\php\includes "

Remove the comment from the last line and change the path back to your pear path, for example:
include_path = ".; C:\php\pear\ "
Save the php.ini, and then restart Apache.


---------------
Pear Command Help
---------------
You can find the pear.php file in your pear directory, which is the command to manage pear, used in cmd. Some of its commands function as follows:

Installation:

Install a pear library from the Internet:
Pear Install PackageName

Download packages but uneasy outfit:
Pear Download PackageName
Pear Download-all

Mounted Package:
Pear Install filename.tgz

List:

The list of all available pear repositories on the Pear Web site today:
Pear remote-list

List Mounted Package:
Pear List

List the package that can be upgraded:
Pear List-upgrades

Update (upgrade):

Update package:
Pear Upgrade PackageName
Pear Upgrade-all

Removal:

To delete an installed package:
Pear Uninstall PackageName

----------------
To install a new package
----------------
For example, you downloaded a new package from http://pear.php.net/package/xxx.tgz.
Copy it to the C:\PHP\PEAR\go-pear-bundle directory and enter it in CMD:
Pear Install xxx.tgz
On the line, the related files were extracted to the C:\PHP\PEAR\ corresponding directory.

---------------
Instance
---------------
Download the Pear::html_common and Pear::html_quickform packages, and then install.
Build a new PHP file, 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 ', ' please login ');
$form->addelement (' text ', ' name ', ' username: ');
$form->addelement (' Password ', ' password ', ' Password: ');
$form the->addelement (' Submit ', ' submit ', ' submit ');
Output to Browser
$form->display ();
?>
</BODY>
</HTML>

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.