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.