PEAR and PHPUnit for Windows 7 with WAMP

I know that there are already several threads, but I hit a brick wall and cannot find the threads with the same problem as now. In a nutshell, my problem is that the PEAR configuration is still installed in the C: \ Windows directory, where it always (correctly) fails due to permissions. I added system environment variables as follows, so I don't know why they seem to be 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 mistake

 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 installation 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 tried to remove the installation and start from scratch, but still not a cube. Anyone have any ideas on this?

+4
source share
2 answers

Try updating your PEAR installation by requesting http://pear.php.net/go-pear.phar in your browser and save the output in a local go-pear.phar file; then run php go-pear.phar from the CLI. This will allow you to reconfigure the paths and IIRC, as well as create a reg file that you can simply double-click to import environment variables.

Also, be sure to reset your account when adding environment variables.

+5
source

Try changing the ini location by changing some registry entries

in accordance with this question

PEAR on Windows: how to change pear.ini location

Here you can find the location of "sysconf" and change it

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

All Articles