toxalot
toxalot

Reputation: 11810

Where should I install phpDocumentor 2?

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

Upvotes: 2

Views: 1134

Answers (2)

toxalot
toxalot

Reputation: 11810

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

/opt is reserved for the installation of add-on application software packages.

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

Upvotes: 2

amarjit singh
amarjit singh

Reputation: 461

Use the command below to install the phpdoc.

sudo pear install PhpDocumentor
password *****

or

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

Upvotes: 1

Related Questions