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.
Steps:
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.
MMm on centos 6 there is another (simpler IMHO) option:
Enable EPEL repo on your system, then
# yum install php-phpunit-PHPUnit
There is also a message indicating that distribution of PHP unit through PHP channel will be closed in Dec 2014.
Finally, in the installation manual recommends the installation using a PHAR archive?
http://phpunit.de/manual/current/en/installation.html
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.
I’ve been fighting PEAR for a while now. The EPEL solution worked for me. Thank you so much! 🙂