Setting up phpweb for local development

See https://github.com/php/web-php/#local-development

Alternatively, the generated files can also be fetched from your nearest mirror, see the following instructions

How to create a PHP.net mirror

Setting up an unofficial mirror is described within the official mirror page. You can also build a mirror from the Git sources, which is especially helpful for those working on the PHP website.

Quick Script to Set Up PHPWeb

Save the following shell script as phpweb.sh Then execute ./phpweb.sh

And wait for ca 10 minutes.

#!/bin/sh
mkdir ~/php.net
cd ~/php.net
 
# Checkout the manual base sources
git clone https://github.com/php/doc-base.git
# Checkout the english manual sources
git clone https://github.com/php/doc-en.git en
# Checkout PHD to build documentation
git clone https://github.com/php/phd.git phd
# Checkout the actual website (does not include /distribution, thats a gigantic separate repo)
git clone https://github.com/php/web-php.git phpweb
cd phpweb
 
# Some files are pre-generated on master.php.net for various reasons
(cd include && for i in countries.inc last_updated.inc mirrors.inc pregen-confs.inc pregen-events.inc pregen-news.inc; do wget "http://www.php.net/include/$i" -O $i; done;)
(cd backend && for i in ip-to-country.db ip-to-country.idx; do wget "http://www.php.net/backend/$i" -O $i; done;)
cd ..
 
 
# Install PhD and build the manual
php doc-base/configure.php
php -dmemory_limit=2G phd/render.php --docbook doc-base/.manual.xml -P PHP -f php
 
cd phpweb
# Symlink the generated english documentations from our PhD build dir
rm -rf manual/en
(cd manual && ln -s `pwd`/../../output/php-web en)
 
php -S localhost:8080 .router.php