If you want 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 with the settings outlined below.
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.
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 of 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/**'
after "--delete-after" in the command line above (substituting your prefered language code in place of 'en'). You can also exclude the distributions directory by adding "--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.
Now, 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.
Rename the configuration.inc-dist file to configuration.inc and edit it appropriately.
Once you create a virtualhost which looks something like:
<VirtualHost your-hostname-here>
ServerName your-hostname-here
ServerAlias xx.php.net www.xx.php.net
ServerAdmin yourname@yourdomain.com
DocumentRoot /www/htdocs/phpweb
php_value include_path .:/www/htdocs/phpweb/include
php_flag register_globals on
ErrorLog logs/error_log
TransferLog logs/access_log
DirectoryIndex index.php index.html
ErrorDocument 404 /error/index.php
ErrorDocument 403 /error/index.php
AddType application/octet-stream .chm
AddType application/octet-stream .bz2
# next line is only necessary if generating stats (see stats/README.stats)
Alias /stats/ /path/to/local/stats/
</VirtualHost>
modified to reflect your local paths and country, of course, then your 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 should set up your ServerName to be "xx2.php.net". For a list of what's available and what is taken, have a look at the list of mirrors.
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:
23 * * * * /usr/local/bin/rsync -avzC --delete --delete-after rsync.php.net::phpweb /your/local/path
You should try to stagger your times a bit from the example to help spread the load on the rsync.php.net server.
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's happening, you can subscribe, by sending an empty message to: php-mirrors-subscribe@lists.php.net
We would like to thank you for providing php.net with a mirror, so if you would like to display a logo on the site promoting your mirror, 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.
Thank you for being a mirror!