Installing PHPUnit with Zend Server (CE) on Windows using PEAR
After a few hours of trying to figure out what was failing each time, I think I’ve finally found the solution (which is a combination of various other tidbits of information I’ve picked up from other blogs)
Firstly, assuming you’ve got a stock installation of Zend Server or Zend Server CE, it will be installed at:
C:\Program Files\Zend\ZendServer\
Therefore the PEAR setup batch file will be located at:
C:\Program Files\Zend\ZendServer\bin\go-pear.bat
If you run this from the command line (go to the bin directory then type “go-pear”) it will prompt you with the setup configuration for PEAR. The prompt will look something like this:
Are you installing a system-wide PEAR or a local copy?(system|local) [system] : system Below is a suggested file layout for your new PEAR installation. Tochange individual locations, type the number in front of thedirectory. Type 'all' to change all of them or simply press Enter toaccept these locations.
The issue that was causing my installation in particular to fail (which is not an issue with say XAMPP or other bundles) is that Zend Server installs by default to your Program Files directory, which has a space in it. PEAR doesn’t play well with spaces, so you will need to change your Temporary directory for processing and Temporary directory for downloads to something without a space such as C:\Temp or C:\tmp
Type “all” to change them all and simply enter replacement paths for the temporary directories, then hit enter when re-prompted. This should install PEAR and create a Registry file for you to merge (it will say where it created it, which should be in the same directory you just ran go-pear.bat in)
Type “pear” at the command line to see if it installed properly. Once it’s working OK type the following:
pear channel-discover pear.phpunit.depear channel-discover components.ez.nopear channel-discover pear.symfony-project.compear update-channels
This will add the channels that contain the packages required by PHPUnit (you’ll need all 3) then updates all available channels
pear upgrade pear
This will upgrade PEAR in case it is not up to date.
pear install --alldeps phpunit/PHPUnit
This will install PHPUnit from the correct channel with all the dependencies it requires (which is what the Symfony and eZ Component channels are needed for)
The problems I encountered which aren’t covered elsewhere is the fact that PEAR will fail trying to download and install packages if you don’t change the temporary directories, and that without the additional channels (not just the PHPUnit channel) it doesn’t seem to be able to work out where the dependencies are even though it knows they are required.
Leave a comment
Categories
- Been knackered for days on end, long day with relatives today then most of tomorrow in the office doing downtime maintenance. I should rest!
- Dinner with my mom, couz and uncle (@ Gold Mine) http://t.co/pj4iA2Ul
- Om nom nom http://t.co/Kd2CIzs9
- I'm at Westfield London Shopping Centre (Shepherd's Bush, Greater London) w/ 13 others http://t.co/b2kCzQOG
- Off to see relatives (@ Northampton Railway Station (NMP) w/ 2 others) http://t.co/3ekCATN8
Recent Posts
- Use Zend_Log_Writer_Firebug to debug AJAX requests using Firebug
- Using Zend_Db_Profiler_Firebug to show database queries per page
- Checking $mixed parameter type for PHP methods
- “concrete5 cannot parse the PATH_INFO or ORIG_PATH_INFO information provided by your server.”
- Enable hibernation on HP MicroServer for Windows Home Server v1




