ZendServer installs PHP CLI as part of the installation, and, as is customary for PHP 4.3+, includes a PEAR installer. It’s a good idea to install PEAR before installing PHPUnit as per the recommendation here.
- Open Zend\ZendServer\bin\go-pear.bat and change the line:
%PHP_BIN% -d output_buffering=0 -d PEAR\go-pear.pharto (see PHAR Runtime Configuration):
%PHP_BIN% -d output_buffering=0 -d phar.require_hash=0 PEAR\go-pear.pharThis will stop the fatal error:
phar...does not have a signatureas by default PHP will not process a PHAR archive without a signature.
- Run go-pear.bat
For Windows 7, make sure you open the console as an administrator, or the installer won’t be able to create some folders in the default install locations. At the command prompt enter:
#cd \program files\zend\zendserver\binand you should get something like this (I selected the system-wide install and accepted the default locations):
If the installation succeeded, you should see something like:
Note that c:\program files\zend\zendserver\bin is already in Windows Path, thanks to ZendServer.
- Update PEAR Trying to install PHPUnit at this point will fail, complaining of an outdated installer. Update the PEAR package:
# pear channel-update pear.php.net
# pear upgrade pear
- Add the PHPUnit channels – see Installing PHPUnit
# pear channel-discover pear.phpunit.de
# pear channel-discover pear.symfony-project.com
- Finally install PHPUnit
# pear install phpunit/PHPUnitIf the installation runs successfully you should see:
You can check your PHPUnit by running it from the command prompt: