PHP 5.0 Pear Installation Method _php Tutorial

Source: Internet
Author: User
Tags pear
Pear is a php extension and application library, contains a lot of useful classes, after installing the php5.0, pear is not actually installed, the installation method is as follows:
1. In the PHP directory, double-click Go-pear.bat.
2. Follow the prompts to enter some 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 directly enter
3. Then you will be prompted for some packages and PHP bindings, select Y.
4. Then install the basic package and prompt the installation to succeed, as simple as that.
5. Open the php.ini file under the Windows directory and look for 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 then change the back path 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 for managing pear, which is used in CMD. Some of its command functions are as follows:

Installation:

Install a pear library from the Web:
Pear Install PackageName

Download packages but uncomfortable:
Pear Download PackageName
Pear Download-all

Installation of the downloaded package:
Pear Install filename.tgz

List:

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

List Installed packages:
Pear List

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

Update (upgrade):

Update package:
Pear Upgrade PackageName
Pear Upgrade-all

To remove:

Remove the installed package:
Pear Uninstall PackageName

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

---------------
Instance
---------------
Download the Pear::html_common and Pear::html_quickform packages and install them.
Build a new PHP file, enter the code




<title>Pear::html_quickform</title>




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 ', ' User name: ');
$form->addelement (' Password ', ' password ', ' Password: ');
$form->addelement (' Submit ', ' submission ', ' submissions ');
Output to Browser
$form->display ();
?>

http://www.bkjia.com/PHPjc/317328.html www.bkjia.com true http://www.bkjia.com/PHPjc/317328.html techarticle Pear is a php extension and application library, contains a lot of useful classes, after installing the php5.0, pear is not actually installed, the installation method is as follows: 1. In the PHP directory, double-click go-pear ....

  • 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.