Take the 2-minute tour ×

I want to manually install phpDocumentor 2 on Unix using the installer.

I have limited knowledge of the command line, but I do have root access. The instructions say to download the installer to the intended location. So where should I download/install it to?

I realize I can put it anywhere I want, but I am interested in knowing some standard locations and why one location might be better than another.

Also, will the installer create it's own parent directory? Or should I create that? I'm never clear on that. For example, I don't want to end up with /usr/bin/phpDoc/phpDoc

share|improve this question
add comment

2 Answers

Use the command below to install the phpdoc.

sudo pear install PhpDocumentor
password *****


pear install PhpDocumentor

It will be installed on the following path.

cd /usr/lib/php/pear/data/PhpDocumentor

Type the following command to see the help.

phpdoc -h

To create the PHP documentation, use the following command.

phpdoc -o HTML:frames:earthli -f pathofthefile/sample1.php -t docs
share|improve this answer
I don't have pear and want to manually install phpDocumentor. –  toxalot Mar 17 '13 at 5:14
To install pear on mac go to blog.stealth35.com/2011/07/27/install-pear-on-osx-lion.html –  amarjit sngh Mar 24 '13 at 18:11
Here is the pear installation guide pear.php.net/manual/en/installation.getting.php –  amarjit sngh Mar 24 '13 at 18:13
add comment
up vote 0 down vote accepted

Where to Install

If the intention is to install it in a common shared location, /opt would be a good place.

Quoting from Filesystem Hierarchy Standard


Parent Directory

The installer for manual installation seems to have disappeared since the question was posted. But according to their home page, you can download the tarball (not the source code!) from GitHub and extract it into your destination directory.

If you open the tarball, you'll see that the top directory is phpDocumentor-2.3.0 (where 2.3.0 is the version). So when you extract that, you'd end up with /path/to/current/dir/phpDocumentor-2.3.0/...

Consider PEAR

You should consider installing PEAR. PEAR itself is just a package manager. Installing the package manager doesn't install all the optional PEAR packages. It's really easy to install PEAR with a package manager like yum or apt-get.

There are a couple of advantages to installing phpDocumentor with PEAR.

  • It's easier to upgrade when there's a new release.
  • You can call it with just phpdoc instead of [PHPDOC_FOLDER]/bin/phpdoc.php

Installing with PEAR

If you use the command pear install PhpDocumentor, you get the newest version available from the default channel. At time of writing, that's 1.5.0a1 (alpha) which is deprecated.

To get the newest release, install it from the phpdoc channel.

pear channel-discover pear.phpdoc.org
pear install phpdoc/phpDocumentor
share|improve this answer
add comment

Your Answer


