Getting And Installing Phing

2nd January 2009 - 2 minutes read time

To get Phing you will need to have PEAR installed along with PHP. On a Windows system you can install PEAR by running the go-pear.bat file and running through the prompts there.

To get Phing just run the following commands.

  1. pear channel-discover
  2. pear install --alldeps phing/phing

You should see the install output looking like this:

  1. downloading phing-current.tgz ...
  2. Starting to download phing-current.tgz (361,527 bytes)
  3. .........................................................................done: 361,527 bytes
  4. install ok: channel://

You can now run Phing by typing the following command:


However, this will automatically try to find a file in the current directory called build.xml, and if it doesn't find this file it will simply state the following before stopping:

Buildfile: build.xml does not exist!

This build.xml file (although it doesn't have to be called this) is what controls what phing will do and is what you will spend most of your time looking at.

You can view which version of phing you are running by using the -v parameter.

phing -v

Which prints out something like:

Phing version 2.1.1

To view a list of available commands use the -h parameter.

phing -h

Which will print out:

  1. phing [options] [target [target2 [target3] ...]]
  2. Options:
  3. -h -help print this message
  4. -l -list list available targets in this project
  5. -v -version print the version information and exit
  6. -q -quiet be extra quiet
  7. -verbose be extra verbose
  8. -debug print debugging information
  9. -logfile <file> use given file for log
  10. -logger <classname> the class which is to perform logging
  11. -f -buildfile <file> use given buildfile
  12. -D<property>=<value> use value for given property
  13. -find <file> search for buildfile towards the root of the
  14. filesystem and use it
  16. Report bugs to <[email protected]>

Automated Build With Phing


All works well but how to create build.xml ?

Anonymous (Fri, 11/12/2010 - 04:40)

Add new comment

The content of this field is kept private and will not be shown publicly.