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