PHPUnit Installation using PEAR

PHPUnit Installation using PEAR


Installing PHPUnit


PHPUnit should be installed using the PEAR Installer. This installer is the backbone of PEAR, which provides a distribution system for PHP packages, and is shipped with every release of PHP

The PEAR channel (pear.phpunit.de) that is used to distribute PHPUnit needs to be registered with the local PEAR environment. Furthermore, a component that PHPUnit depends upon is hosted on the Symfony Components PEAR channel (pear.symfony-project.com).


#> pear channel-discover pear.phpunit.de
#> pear channel-discover components.ez.no
#> pear channel-discover pear.symfony-project.com


This has to be done only once. Now the PEAR Installer can be used to install packages from the PHPUnit channel:

Check the List of Packages in Remote PHPUnit.
#> pear remote-list -c phpunit
Install PHPUnit Using this command
#> pear install phpunit/PHPUnit
Check the Installed PHPUnit Packages
#> Pear list -c phpunit
Check PHPUnit_Selenium installed in that list.


After the installation you can find the PHPUnit source files inside your local PEAR directory; the path is usually /usr/lib/php/PHPUnit. Or /usr/local/lib/php/PHPUnit


If you are facing installation error while follow the above steps?
Then Try this.


pear update-channels
pear install --onlyreqdeps phpunit/PHPUnit.

Ant Instalaltion

Ant Installation in Linux:

Download Ant from http://ant.apache.org/bindownload.cgi

Unzip the ant and rename the folder as ant

move that folder in to /usr/local/

Check the JDK 1.6 installed in your machine by

#> java -version

Set path in the .bash_profile

Open the file /root/.bash_profile and add the following codes:

# vim /root.bash_profile

export ANT_HOME=/usr/local/ant

export JAVA_HOME=/opt/java/jdk1.6

export PATH=${PATH}:${ANT_HOME}/bin

#> ant -version

it will show the current installed version.



Ant Installation in Windows:

Download Ant from http://ant.apache.org/bindownload.cgi

Unzip the ant and rename the folder as ant

move that folder in to c:\

Check the JDK 1.6 installed in your machine by

#> java -version

Right click My Computer icon

* Choose properties

* Choose Advanced Tab

* Choose Environment Variables Button

* In the System Variables, click New Button

* Give the Variable Name:ANT_HOME Give the Value: C:\Ant

* Click OK


* Then Edit the PATH variable, at the end of the line add this: %ANT_HOME%\bin;

* Click OK to finish

In the command prompt type

ant -version

you will get the result like this

Apache Ant version X.x.X compiled at XXXX.