PHPUnit on CentOS 6

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

4. Install PHPUnit:

pear install --alldeps

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.

3 thoughts on “PHPUnit on CentOS 6

  1. Craig Post author

    Thank you for the information. I don’t remember why I didn’t install PHPUnit via EPEL, since I use EPEL to install other software. This post was written a year ago-perhaps the right version of PHPUnit wasn’t available in EPEL at that time.


Leave a Reply