phpDocumentor has several dependencies on other software packages. Please make sure that you have these installed before installing phpDocumentor.
PEAR provides the latest released version of phpDocumentor and is an easy way to set up your machine.
You can prepare your PEAR installation using the following commands:
$ pear channel-discover pear.phpdoc.org
And to install phpDocumentor you can use the following command:
$ pear install phpdoc/phpDocumentor
When the installation is finished you can invoke the phpdoc command from any path in your system. It is recommended to read the Getting started section next as it will explain how to quickly start using phpDocumentor.
You can download the latest PHAR file from http://www.phpdoc.org/phpDocumentor.phar.
Some installations of PHP can have trouble executing the phar file. If you have any issues, please consult the following website first: http://silex.sensiolabs.org/doc/phar.html#pitfalls
The phar file can be used by simply invoking php and providing the phar file as a parameter:
$ php phpDocumentor.phar -d . -t docs/api
Installing phpDocumentor using Composer is a matter of creating a directory to host your files and executing the following command:
$ composer require "phpdocumentor/phpdocumentor:2.*"
This command can also be used to add phpDocumentor to your existing composer-based project
phpDocumentor uses a fair number of other libraries, if you do not want those dependencies imported into your own project it is advised to use one of the other installation methods.