在wamp的梨安装

时间:2013-02-21 16:40:14

标签: php wamp pear

我正在Windows 7上运行wamp 2.2。当我尝试 pear install phpunit / PHPUNIT 时。它显示了一些 mkdir 问题。然后我试试

pear config-set autodiscover 1

PEAR_Config :: writeConfigfile fopen<'C:\ windows \ pear.ini','w'> faild<'C:\ windows \ pear.ini'>:无法打开流:权限被拒绝
然后我检查了我的pear.bat文件。我在下面看到一些警告,

REM launch pearcmd
GOTO RUN
:PEAR_INSTALL_ERROR
ECHO PHP_PEAR_INSTALL_DIR is not set correctly.
ECHO Please fix it using your environment variable or modify
ECHO the default value in pear.bat
ECHO The current value is:
ECHO %PHP_PEAR_INSTALL_DIR%
GOTO END
:PEAR_INSTALL_ERROR2
ECHO PHP_PEAR_INSTALL_DIR is not set correctly.
ECHO pearcmd.php could not be found there.
ECHO Please fix it using your environment variable or modify
ECHO the default value in pear.bat
ECHO The current value is:
ECHO %PHP_PEAR_INSTALL_DIR%
GOTO END
:PEAR_BIN_ERROR
ECHO PHP_PEAR_BIN_DIR is not set correctly.
ECHO Please fix it using your environment variable or modify
ECHO the default value in pear.bat
ECHO The current value is:
ECHO %PHP_PEAR_BIN_DIR%
GOTO END
:PEAR_PHPBIN_ERROR
ECHO PHP_PEAR_PHP_BIN is not set correctly.
ECHO Please fix it using your environment variable or modify
ECHO the default value in pear.bat
ECHO The current value is:
ECHO %PHP_PEAR_PHP_BIN%
GOTO END

2 个答案:

答案 0 :(得分:1)

安装程序正在寻找您的PEAR目录在环境变量PHP_PEAR_INSTALL_DIR中。这里提供的说明是在pear.bat中设置安装目录或设置该环境变量。

答案 1 :(得分:1)

“无法打开流:权限被拒绝”表示由于缺少写入权限而无法写入。我看到它正在尝试写入Windows文件夹而你正在使用Windows 7.UAC可能会阻止写入尝试。如果您还没有尝试在具有提升权限的命令窗口中运行批处理文件,我建议这样做。

右键单击CMD>以管理员身份运行

执行.bat文件