Install phpunit on ubuntu

February 21st, 2012 § 0 comments § permalink

A few months before I wrote an article on how to install phpunit on windows. Now when I tried to install phpunit on ubuntu I faced an error phpunit/PHPUnit requires PEAR Installer (version >= 1.9.4), installed version is 1.9.2 .

Here is the steps which I used to get rid of this error.

  1. Install php-pear
     sudo apt-get install php-pear
  2. Update its own channel
     sudo pear channel-update
  3. Upgrade pear
    sudo pear upgrade-all
  4.  Now install PHPunit
    sudo pear install –alldeps 
Now we can check whether installation is success by typing phpunit in terminal.

Yes. It worked.

Happy Testing.

install pear and php unit

March 18th, 2011 § 2 comments § permalink

Here is the step by step procedure to install pear and PHPUnit framework.
You can install pear either through browser or through command line. I highly recommend you to use command line since i failed twice in browser.

Make sure you added a path to php.exe into the Environment variable(php) in windows.

 cd /path/to/php/
 php.exe path/to/go-pear.php
  • A wizard will take you to provide settings

IF the installation is success now its time to install the PHPUnit framework

  • run these commands
 pear channel-discover
 pear channel-discover
 pear channel-discover
 pear install phpunit/PHPUnit