简体   繁体   English

梨和 PHPUnit 上 Windows 7 与 WAMP

[英]PEAR & PHPUnit on Windows 7 with WAMP

I know there are several threads on this already, but I've hit a brick wall and can't find any threads with the same issue I now have.我知道这已经有几个线程了,但是我碰到了一堵砖墙,找不到任何与我现在遇到的相同问题的线程。 In a nutshell, my problem is that PEAR's config is still set to the C:\Windows directory, where it always (correctly) fails due to permissions.简而言之,我的问题是 PEAR 的配置仍然设置为 C:\Windows 目录,它总是(正确地)由于权限而失败。 I've added System environment variables as follows, so I don't know why these seem to be getting ignored:我添加了如下系统环境变量,所以我不知道为什么这些似乎被忽略了:

PHP_PEAR_BIN_DIR=C:\wamp\bin\php\php5.3.4
PHP_PEAR_DATA_DIR=C:\wamp\bin\php\php5.3.4\PEAR\data
PHP_PEAR_DOC_DIR=C:\wamp\bin\php\php5.3.4\PEAR\docs
PHP_PEAR_INSTALL_DIR=C:\wamp\bin\php\php5.3.4\pear
PHP_PEAR_PHP_BIN=C:\wamp\bin\php\php5.3.4\php.exe
PHP_PEAR_SYSCONF_DIR=C:\wamp\bin\php\php5.3.4
PHP_PEAR_TEST_DIR=C:\wamp\bin\php\php5.3.4\PEAR\tests

typical error is典型的错误是

C:\wamp\bin\php\php5.3.4>pear channel-discover pear.phpunit.de
PEAR_Config::writeConfigFile fopen('C:\Windows\pear.ini','w') failed (fopen(C:\Windows\pear.ini): failed to open stream:
 Permission denied)

My initial install commands were as follows:我的初始安装命令如下:

php -d phar.require_hash=0 PEAR/go-pear.phar
pear channel-discover pear.phpunit.de
pear channel-discover components.ez.no
pear channel-discover pear.symfony-project.com
pear install phpunit/PHPUnit

I've tried removing the install and starting from scratch, but still no dice.我已经尝试删除安装并从头开始,但仍然没有骰子。 Anyone have any ideas on this?有人对此有任何想法吗?

Try to update your PEAR installation by requesting http://pear.php.net/go-pear.phar in your browser and save the output to a local file go-pear.phar;尝试通过在浏览器中请求http://pear.php.net/go-pear.phar来更新您的 PEAR 安装,并将 output 保存到本地文件 go-pear.phar; then run php go-pear.phar from the CLI.然后从 CLI 运行 php go-pear.phar。 This will let you reconfigure the paths and IIRC it will also create a reg file you can simply doubleclick to import the environment variables.这将让您重新配置路径,IIRC 它还将创建一个 reg 文件,您只需双击即可导入环境变量。

Also make sure to relog to your account when adding environment variables.添加环境变量时,还要确保重新登录到您的帐户。

Try to change the ini location modifying some entries in the registry尝试更改 ini 位置以修改注册表中的某些条目

according to this question根据这个问题

PEAR on Windows: How to change pear.ini location Windows 上的 PEAR:如何更改 pear.ini 位置

You can find the location of the "sysconf" here and alter it您可以在此处找到“sysconf”的位置并进行更改

[HKEY_CURRENT_USER\Environment]
"PHP_PEAR_SYSCONF_DIR"="D:\\webserver\\xampp\\php"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM