Method for successfully installing PEAR in WIN

Source: Internet
Author: User
Tags pear

I used WAMP2.1 and reported an error when installing PEAR. After a few tossing times, I finally installed the PEAR. Let's take a look at the error:

According to the information on the Internet, said to run WAMP installation directory under the PHP Directory of the go-pear.bat batch file to install. The location of the PEAR directory of WAMPSERVER2.1 is slightly different (For details, refer to the highlighted section ). The above error occurs after running, indicating that the installation failed.

The solution is to run the following statement.

Copy codeThe Code is as follows: E: \ wamp \ bin \ php \ php5.3.3> php-d phar. require_hash = 0 PEAR/go-pear.phar

If the operation is successful, it is shown in

Mark 1 in the figure: the statement to be run to install PEAR

Mark 2 in the figure: Press enter.

Marked 3 in the figure: continue to press ENTER

A bunch of English letters are displayed.

Ask if you can modify the php. ini file. Enter Y and press Enter.

The last line prompts you to press enter to continue. After you press enter, the entire installation process is completed (that is, one-way carriage return)

After the PEAR is installed, several PEAR packages are installed by default. Enter the pear list to display the PACKAGE list.

Marked 1 in the figure: list all installed PEAR packages

Mark 2 in the figure: Install the Mail class

Marked 3 in the figure: the Mail class is successfully installed (highlighted)

Tell PHP your PEAR installation directory

Change include_path in php. ini to the PEAR installation directory.

Copy codeThe Code is as follows:

; Paths and Directories;

; UNIX: "/path1:/path2"
; Include_path = ".:/php/shortdes"

; Windows: "\ path1; \ path2"
Include_path = ".; c: \ php \ shortdes"

Change the last line to the installation directory of your own PEAR.

Include_path = ".; E: \ wamp \ bin \ php \ php5.3.3 \ PEAR"

Restart WAMP, create a php file, and run the following statement. If no error is reported, the installation is successful (if the file name of Mail. php is not found in the running directory)Copy codeThe Code is as follows: <? Php
Require_once ("Mail. php ");
?>

Query the PEAR package and installation command can visit the PEAR official website http://pear.php.net/index.php

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.