doc:articles:localdocsetup
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
doc:articles:localdocsetup [2011/06/05 03:56] – s/http/https for svn.php.net urls philip | doc:articles:localdocsetup [2017/09/22 13:28] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Checking out, building, and viewing the PHP documentation on an unofficial php.net mirror ====== | + | This page has been removed, in favor of [[http:// |
- | + | ||
- | Viewing results as a php.net mirror isn't a simple process, but it can be done. The following is one route, and it assumes: | + | |
- | + | ||
- | * PHP 5.3+ is available | + | |
- | * A web server, specifically (in this example) Apache | + | |
- | * The **rsync** tool is available | + | |
- | * A basic level of shell/ | + | |
- | * A desire to build and display the documentation locally | + | |
- | * Your PHP Documentation path will be: **/ | + | |
- | * Your local mirror path will be: **/ | + | |
- | * Your local hostname will be: **http:// | + | |
- | * You are using Linux or a Mac (@todo Make this guide Windows friendly) | + | |
- | + | ||
- | If you're interested in simply setting up a local PHP mirror (and NOT build the documentation) then simply follow the php.net mirroring guidelines and ignore this document. | + | |
- | + | ||
- | ===== Checkout the php documentation from SVN ===== | + | |
- | + | ||
- | Assumptions: | + | |
- | + | ||
- | ==== Option #1 : Traditional ==== | + | |
- | <code shell> | + | |
- | $ mkdir /tmp/svn | + | |
- | $ cd /tmp/svn | + | |
- | $ svn co https:// | + | |
- | $ cd / | + | |
- | </ | + | |
- | ==== Option #2 : Automated ==== | + | |
- | <code shell> | + | |
- | $ cd /tmp | + | |
- | $ wget https://svn.php.net/repository/phpdoc/ | + | |
- | $ php create-phpdoc-setup.php -h | + | |
- | $ php create-phpdoc-setup.php -b /tmp/svn -l en | + | |
- | $ cd / | + | |
- | </ | + | |
- | ===== Validate the PHP Documentation XML ===== | + | |
- | <code shell> | + | |
- | $ cd / | + | |
- | $ php doc-base/ | + | |
- | </ | + | |
- | ===== Build the documentation ===== | + | |
- | + | ||
- | We use PhD to build the documentation. It takes the source that configure.php generates, and builds and formats the PHP documentation. PhD offers several formats including HTML (multiple or single page), PDF, Man, Epub, and others, including PHP which is what we use at php.net. | + | |
- | + | ||
- | ==== Install PhD ==== | + | |
- | + | ||
- | === Option #1 : Traditional === | + | |
- | + | ||
- | Requirements: | + | |
- | <code shell> | + | |
- | $ pear install phpdocs/ | + | |
- | $ pear install phpdocs/ | + | |
- | $ phd --help | + | |
- | </ | + | |
- | === Option #2 : Automated === | + | |
- | + | ||
- | The create-phpdoc-setup.php installs PhD. | + | |
- | + | ||
- | ==== Use PhD to build the documentation ==== | + | |
- | <code shell> | + | |
- | $ cd / | + | |
- | $ php doc-base/ | + | |
- | $ phd --docbook / | + | |
- | $ cd / | + | |
- | $ ls | + | |
- | </ | + | |
- | Note: This builds the php.net version of the documentation, | + | |
- | + | ||
- | | + | |
- | <code shell> | + | |
- | $ phd --docbook / | + | |
- | $ cd / | + | |
- | $ open strlen.html | + | |
- | </ | + | |
- | ===== Setup a local php.net mirror ===== | + | |
- | + | ||
- | ==== Setup an Apache virtual host ==== | + | |
- | + | ||
- | The official PHP mirroring documentation contains a detailed example for doing this, but here's a simpler example: | + | |
- | + | ||
- | ==== Download (rsync) the php.net files ==== | + | |
- | + | ||
- | <code shell> | + | |
- | $ rsync -avzC --timeout=600 --delete --delete-after --exclude=' | + | |
- | </ | + | |
- | + | ||
- | ==== Symlink (or move) the generated PHP documentation to your local php.net sources ==== | + | |
- | + | ||
- | <code shell> | + | |
- | $ ln -s / | + | |
- | </ | + | |
- | + | ||
- | ==== Configure Apache ==== | + | |
- | + | ||
- | * Open the apache configuration file (e.g., apache.conf, | + | |
- | * Add the virtual host: | + | |
- | + | ||
- | < | + | |
- | < | + | |
- | < | + | |
- | Options -Indexes -MultiViews | + | |
- | </ | + | |
- | + | ||
- | | + | |
- | | + | |
- | + | ||
- | # Set directory index | + | |
- | | + | |
- | + | ||
- | # Handle errors with local error handler script | + | |
- | | + | |
- | | + | |
- | | + | |
- | + | ||
- | # Add types not specified by Apache by default | + | |
- | | + | |
- | | + | |
- | + | ||
- | # Set mirror' | + | |
- | | + | |
- | + | ||
- | | + | |
- | + | ||
- | # Turn spelling support off (which would break URL shortcuts) | + | |
- | < | + | |
- | | + | |
- | </ | + | |
- | </ | + | |
- | </ | + | |
- | + | ||
- | * Adjust /etc/hosts by adding the following: | + | |
- | < | + | |
- | 127.0.0.1 | + | |
- | </ | + | |
- | * Restart Apache | + | |
- | <code shell> | + | |
- | $ sudo apachectl restart | + | |
- | </ | + | |
- | ===== View the new site ===== | + | |
- | + | ||
- | * http:// | + |
doc/articles/localdocsetup.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1