If you wish to get the latest PHP source tree, you can obtain it through Git. You should be warned that the Git version is a development version, and as such, is often unstable, and may not even compile properly. The advantage of using Git, though, is that you can get the latest fixes and updates, without having to wait for the official releases.
PHP uses an advanced configuration system that requires you to have the following tools. re2c is only necessary for developers and can be found here. All other utilities can be obtained from the GNU FTP site.
If you're experiencing problems, see also the section on buildconf failures.
git clone https://github.com/php/php-src.git
git clone http://git.php.net/repository/php-src.git
git checkout PHP-5.4
git checkout PHP-5.5
git checkout PHP-5.6
git checkout PHP-7.0
git checkout master
Note that certain combinations of autoconf, automake and libtool may not
work when used together, particularly with historical versions of PHP. See
below for details.
Also, certain versions of autoconf may generate warnings of
called before AC_PROG_CC. These messages can usually be ignored.
./buildconfto generate the configure script. This may take several moments.
There are many other things, such as the XML source code for the documentation, available via Git. See the web-based view of the Git server to see what is available.
The PHP Wiki has a useful Git FAQ, which provides useful tips and cheatsheets for using the PHP Git repository, and if you want to become involved in developing PHP, the Git Workflow page is also likely to be of interest.
The PHP manual is still currently hosted on SVN, although it will be migrated
to Git in the future. To checkout the latest English version of the PHP
svn checkout https://svn.php.net/repository/phpdoc/modules/doc-en ./phpdoc-en
You can also check the SVN FAQ on the wiki.
There seem to be problems with libtool 1.4.2. It is suggested that you use libtool 1.4, along with autoconf 2.13 and automake 1.4. You should also ensure that autoconf, automake and libtool are installed in the same directory. libtool 1.5 will not work.
The following combinations are known to work with PHP 5.3 and below:
If you have multiple versions of autoconf installed on your computer, as is
common for many UNIXes, you can set the PHP_AUTOCONF and PHP_AUTOHEADER
variables when running buildconf to indicate which versions it should use
PHP_AUTOCONF=autoconf213 PHP_AUTOHEADER=autoheader213 ./buildconf
PHP only supports flex 2.5.4, not later versions as they broke backwards compatibility. Please note that PHP 5.3 and later do not require flex at all.