Posted on 2 Comments

Install PHPUnit using PEAR in XAMPP

Source Code Icon

In order to install PHPUnit using XAMPP you have to issue the following commands:

sudo ./pear channel-update
sudo ./pear channel-discover
sudo ./pear channel-discover
sudo ./pear channel-discover
sudo ./pear install --alldeps phpunit/PHPUnit

First, you (might have to) update PEAR with the changed protocols used by channel Next, add three channels to satisfy all dependency requirements for PHPUnit. Finally, install PHPUnit using the –alldeps options to automatically discover and install any dependencies. As you might have guessed the commands above originate from a Linux shell (sudo). Therefore, I you plan to use these commands under Windows simply replace “sudo ./pear” with “pear.bat” and you are ready to go. Additionally, depending on your Linux setup and the location of XAMPP you also might not need to be a super user (sudo) to issue these commands.