In my last post, I showed how to install PHPUnit with PHP 5.3 on a CentOS 5.9 system. Today, I will tackle the much simpler task of installing PHPUnit on a CentOS 6.4 system. The task is easier since PHP5.3 is standard on CentOS 6. On my system, PEAR was already installed.
1. Install the PHPUnit channel for PEAR:
yum install php-channel-phpunit
2. Set channel to auto-discover:
pear config-set auto_discover 1
3. Update the channel:
pear channel-update pear.phpunit.de
4. Install PHPUnit:
pear install --alldeps pear.phpunit.de/PHPUnit
5. Install xdebug to show code coverage:
yum install php-pecl-xdebug
As always, I’d like to hear if anything in these instructions didn’t work for you, since I haven’t had a chance to test them on a “fresh” system.