If you would like to become an official PHP mirror, please be sure to read and follow these instructions carefully. You should have the consent of your hosting company (if you aren't a hosting company yourself), and be prepared for some reasonably significant bandwidth usage (a reasonable estimate as of 2/2002 is 150MB/day). The PHP website requires PHP 4.3.x with the settings outlined below. The size of the full website is approximately one gigabyte.
Please note that we are currently only accepting new official mirrors in countries where we don't already have two active official mirrors. For a list of official mirrors have a look at mirrors.php. Before you start to set up an official mirror site, it is advisable to contact mirrors@php.net, and ask if you have chance to get your mirror site accepted. We would not like to put too much pressure on our rsync server, so we need to limit the number of mirror sites.
If you are not an official mirror (eg. mirror the site for your company's internal use), you should not rsync from rsync.php.net more frequently than every three hours, or you may find your IP blocked. Also, please make an effort to only mirror those parts of the site that you actually need. (For example, exclude the manual in all languages that you will not be using and exclude the distributions directory.)
First, you need to have a rsync installed. As you have rsync, fetch the web files with the following:
rsync -avzC --timeout=600 --delete --delete-after \
rsync.php.net::phpweb /your/local/path
Setting up an unofficial mirror, and want to only mirror one language of the manual? Add:
--include='manual/en/' --include='manual/en/**' --exclude='manual/**' --exclude='distributions/manual/'
after "--delete-after" in the command line above (substituting your prefered language code in place of 'en'). You can also exclude the whole distributions directory by replacing "--exclude='distributions/manual'" with "--exclude='distributions/'"
If /your/local/path isn't in your web document tree (why isn't it?), then symlink the phpweb/ directory to the correct place on your server.
PHP mirror sites should provide the exact content coming from rsync.php.net, and should not be altered in any way not described in the mirroring guidelines. Failing to do so can result in immediate removal of your mirror from our list.
SQLite is an embedded SQL database implementation that has very high performance for applications with low write concurrency. PHP mirrors currently employ SQLite for URL shortcut lookups, and will use it for manual page displays and searching in the future.
To install the SQLite PHP extension, you need to have PEAR installed, with which you can get SQLite: % pear install SQLite. Ensure that your php.ini has an extension line to load in the SQLite extension by default, while starting up the webserver.
Make sure your web server is set up to serve up .php files as PHP parsed files. If it isn't, add the mime-type to your config.
Create a virtualhost which looks something like:
<VirtualHost *-or-your-hostname-here>
ServerName *-or-your-hostname-here
ServerAlias xx.php.net www.xx.php.net
ServerAdmin yourname@yourdomain.com
# Webroot of PHP mirror site
DocumentRoot /www/htdocs/phpweb
# These PHP settings are necessary to run a mirror
php_value include_path .:/www/htdocs/phpweb/include
php_flag register_globals on
# Log server activity
ErrorLog logs/error_log
TransferLog logs/access_log
# Set directory index
DirectoryIndex index.php index.html
# Do not display directory listings if index is not present
Options -Indexes
# Handle errors with local error handler script
ErrorDocument 401 /error.php
ErrorDocument 403 /error.php
ErrorDocument 404 /error.php
# Add types not specified by Apache by default
AddType application/octet-stream .chm .bz2 .tgz
AddType application/x-pilot .prc .pdb
# Set mirror's preferred language here
SetEnv MIRROR_LANGUAGE "en"
# The next lines are only necessary if generating
# stats (see below), otherwise you should comment them out
Alias /stats/ /path/to/local/stats/
SetEnv MIRROR_STATS 1
</VirtualHost>
Provide an asterisk or a hostname in the VirtualHost container's header and in the ServerName directive. Consult the Apache documentation for the differences of the two methods. Change the DocumentRoot and include_path settings as appropriate, specify the mirror's preferred language, and provide settings according to your stats setup, if your mirror is going to provide it. For the preferred language setting, choose one from those avilable as manual translations. If you provide something else, your default language will be English. After you restart Apache, your mirror site should start working.
The official names for PHP mirrors are in the convention: "xx.php.net", where "xx" is replaced by the 2-letter country code of your mirror's location. If there already is a "xx.php.net", then you will probably get "xx2.php.net". Please read the note on official mirrors above.
Setting up local stats can be a plus on your mirror. We provide some setup instructions for that.
You must also set up a cron job that periodically does an rsync to refresh your web directory. This will ensure that your web site is up to date. Something like:
* * * * /usr/local/bin/rsync -avzC --timeout=600 --delete --delete-after rsync.php.net::phpweb /your/local/path
Remember to specify the same rsync parameters you used to get the phpweb files. You should try to stagger your times a bit from the example to help spread the load on the rsync.php.net server.
We would like to thank you for providing a mirror, so if you would like to display a logo on the mirror site promoting your company, you are able to do so by following these steps:
The PHP Group do reserve the right to refuse images based on content, but most things should be fine.
We have chosen a banner size which conforms with the Internet Advertising Bureau standards.
And finally, don't forget to put a nice little PHP logo somewhere on your hosting company's site if possible. Grab one of the logos from the Download logos page, and link it to your mirror.
Don't be afraid if you cannot find several pieces of the site in your local copy, like the tutorial PHP page or the printed pages' directories. These are handled automatically on the fly and are not real files.
If you find that the manuals are listed on the documentation page, but all of the links open up a search page, you probably have an Apache /manual/ alias in effect. Remove that alias, restart Apache, and the manuals will be showing up.
If the shortcut features [eg. xx.php.net/echo] are not working, check that the manual files are really under DOCUMENT_ROOT, you have register_globals on, and that at least the English manual is present. Also make sure that you have a correct ErrorDocument setting.
If you have an offical mirror site but it is not listed on mirrors.php, then your mirror is probably detected to be disfunctional for our users. Mirror sites inaccessible for more then three days, not updated for more then seven days, or having any major error in their setup are removed automatically from the listing for our user's convinience. We send out a notification to all automatically disabled mirror site owners every week.
Once you have done the above and your site appears to work, send a message to mirrors@php.net with the following information, and appropriate steps will be taken to integrate your mirror site:
There is a mailing list named "php-mirrors" at lists.php.net. It is not required to sign up to this mailing list. Besides the name, the traffic on this list is mainly interesting for the webmasters of PHP.net, and we are able to keep in touch with you using your given email address. Anyway if you would like to follow what is happening, you can subscribe, by sending an empty message to: php-mirrors-subscribe@lists.php.net
Thank you for being a mirror!