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. Steps: 1. Install the PHPUnit channel for PEAR:
yum install php-channel-phpunit2. Set channel to auto-discover:
pear config-set auto_discover 13. Update the channel:
pear channel-update pear.phpunit.de4. Install PHPUnit:
pear install --alldeps pear.phpunit.de/PHPUnit5. Install xdebug to show code coverage:
yum install php-pecl-xdebugAs 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.
Comments
Comment #1 by Emmanuel BUU
Emmanuel BUU - Aug 5, 2014
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
Comment #2 by Craig
Craig - Sep 5, 2014
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.
Comment #3 by Rich
Rich - Nov 3, 2014
I’ve been fighting PEAR for a while now. The EPEL solution worked for me. Thank you so much! :)