安装pear越来越麻烦了。。
wamp2.5下pear的安装:
1先到pear.php.net下载 go-pear.phar
2.命令行使用
php -d phar.require_hash=0 PEAR/go-pear.phar
来安装pear
win7下由于权限问题,建议使用local安装。一路enter即可
5.4安装pear,装好后运行pear出现:
PHP_PEAR_INSTALL_DIR is not set correctly.
Please fix it using your environment variable or modifythe default value in pear.bat
The current value is:
D:\wamp\bin\php\php5.2.6\pear
以及
PHP_PEAR_BIN_DIR is not set correctly.
Please fix it using your environment variable or modify
the default value in pear.bat
The current value is:
D:\wamp\bin\php\php5.2.6
等问题,我考虑到原来在php5.2.6的环境里装过pear,现在升级php后安装,可能是由于一些老的信息没有清干净导致的。下面是我的解决步骤:
1.首先,根据提示,编辑pear.bat,用PHP_PEAR_INSTALL_DIR 找到这么一句:
IF "%PHP_PEAR_PHP_BIN%"=="" SET "PHP_PEAR_PHP_BIN=D:\wamp\bin\php\php5.4.16\pear"
不知道其他人事怎么样的,我这里设置是正常,如果有人有路径不对可以改一下
2.查找 在php.ini里找一下此错误路径D:\wamp\bin\php\php5.2.6修改之(wamp里有两个php.ini)
3.再检查一下电脑自己的环境设置。(我的电脑-属性--高级-环境变量)
4.编辑php文件夹里的PEAR_ENV.reg,看看路径正确与否
按理说,做完以上这些,pear应该没事儿了,不过仍然死活报错,还是诡异的
The current value is:
D:\wamp\bin\php\php5.2.6
重新安装一遍pear仍然如此,
5.最后如下解决:将
IF "%PHP_PEAR_PHP_BIN%"=="" SET "PHP_PEAR_PHP_BIN=D:\wamp\bin\php\php5.4.16\pear"
直接改为
其他变量类似。世界清静了。。。
SET "PHP_PEAR_PHP_BIN=D:\wamp\bin\php\php5.4.16\pear"