[Install PHPUnit] Installing PEAR and PHPUnit on WAMP and Windows 7 (no longer maintained from PHPUnit 3.7)

First of all, thanks to @Sebastian Bergmann for reminding and sorry for my careless about this reblog because End of Life for PEAR Installation Method to PHPUnit from github and The package PHPUnit is not maintained anymore and has been superseded. Package has moved to channel pear.phpunit.de, package PHPUnit from pear.php.net.

So this blog should be a reblog of installing PHPUnit(<3.7) in Windows7 from http://thecancerus.com/ and I found it was still useful for understanding the theory of configuration of php(in wamp) and the environment variables.

The newest manual installation of PHPUnit in windows can be found its documentation.

Continue reading

Installation and configuration of PHPUnit in Windows

Installation and configuration of PHPUnit in Windows

Version control

Language:PHP 5.3.0(>5.2.7)
Web Server:WampServer Version 2.0
System:Windows 7
Folder path:c:\wamp\bin\php
PHP version should greater than 5.2.7. To install a new version of PHP, click the icon of Wamp, and then php->Version -> Get more.

Attention: if you install a new version PHP, after the installation, it is better to check the environment variable PHP_PEAR_PHP_BIN is point to the new folder of PHP. And the php.ini which will used by command line is the one you could find in the new folder of PHP.

Continue reading

Problem installing PEAR and solution

Today during the confirgration of my phpUnit, when I run C:\wamp\bin\php\php5.3.5>go-pear.bat

I met this problem :

C:\wamp\bin\php\php5.3.5\go-pear.bat

phar “C:\wamp\bin\php\php5.3.5\PEAR\go-pear.phar” does not have a signaturePHP Warning: require_once(phar://go-pear.phar/index.php): failed to open stream: phar error: invalid url or non-existent phar “phar://go-pear.phar/index.php” in C:\wamp\bin\php\php5.3.5\PEAR\go-pear.phar on line 1236

Solution :

Find this code in C:\wamp\bin\php\php5.3.5\php.ini :

[Phar]
; http://php.net/phar.readonly
;phar.readonly = On

; http://php.net/phar.require-hash
;phar.require_hash = On

;phar.cache_list =

Change it to :

[Phar]
; http://php.net/phar.readonly
;phar.readonly = On

; http://php.net/phar.require-hash
phar.require_hash = Off

;phar.cache_list =

A similar problem in stackoverflow :
http://stackoverflow.com/questions/1652941/why-am-i-receiving-an-error-when-installing-pear