PHP Pear installation Error causes the Pear command to be unable to use the workaround

Source: Internet
Author: User
Tags modify pear php web development

Before I introduced the installation method of PHP pear under windows in detail, I reinstalled pear in the Dedeampz\webroot\default directory when I installed the Pear DB Class with the Dedeampz restrictions. However, due to the problem of pear installation environment variable Php_pear_install_dir, it is not always possible to download the Pear DB class through the Pear command to release the solution.

PHP PEAR Installation problem

Originally I installed in the PHP5 directory, after the Dedeampz, I manually removed the pear directory, the pear reinstall in the Dedeampz\webroot\default directory, but the pear command to download the installation of the Pear DB Class error, The error message is as follows

Php_pear_install_dir is not set correctly.

Pearcmd.php could not is found there.

Please fix it using your environment variable or modify

The default value in Pear.bat

The current value is:

E:\phpos\DedeAMPZ\Program\PHP5\pear

Solving method

Based on the above error message, we know that the problem with the Pear DB Class installation error is that the Pear command is not working properly because Pear's installation directory environment variable Php_pear_install_dir was not changed when you reinstalled pear.

The hint tells us that you can fix the problem by modifying the value of the PEAR installation environment variable Php_pear_install_dir in Pear.bat.

Right-click Pear.bat and select Edit, which means you can open this batch file in Notepad. Found it

  REM Check PEAR Global ENV, set them if they does not exist

Modify the following

IF "%php_pear_install_dir%" = "" SET "Php_pear_install_dir=e:\phpos\dedeampz\webroot\default\pear"

For

IF "%php_pear_install_dir%" = "E:\phpos\DedeAMPZ\Program\PHP5\pear" "SET" php_pear_install_dir=e:\phpos\dedeampz\ Webroot\default\pear "

You can overwrite the value of the PEAR installation environment variable PHP_PEAR_INSTALL_DIR.

At this point, PHP pear at the time of installation due to the Php_pear_install_dir (installation directory) value is not correct, resulting in the problem of pear can not be solved.

  Note : PHP Web Development Tutorials-leapsoul.cn Copyright, reproduced in the form of links to indicate the original source and this statement, thank you.







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.