0

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

pear config-set autodiscover 1

PEAR_Config::writeConfigfile fopen<'C:\windows\pear.ini','w'> failed<'C:\windows\pear.ini'>: failed to open stream: Permission denied
然后我检查了我的 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
4

2 回答 2

1

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

于 2013-02-21T16:43:23.610 回答
1

“failed to open stream: Permission denied”表示由于缺少写权限而无法写。我看到它正在尝试写入 windows 文件夹,而您正在使用 windows 7。UAC 可能会阻止写入尝试。如果您没有尝试在具有提升权限的命令窗口中运行批处理文件,我建议您这样做。

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

执行 .bat 文件

于 2013-02-21T16:58:17.447 回答