PHP TestFest VM Documentation - Building PHP

Documentation Home

This file provides instructions for downloading and building the most recent snapshot of PHP 5.2, PHP 5.3 or PHP 6.0. After running the preparation instructions, please skip to the section relevant to the PHP version you are interested in.

Preparation

It's always recommended that you update the installed packages before building any new software on the VM.

sudo apt-get update
sudo apt-get upgrade

Building PHP 5.2

Visit the PHP snaps site using your host to locate the URL for downloading the latest PHP 5.2 snapshot. This URL changes every few hours and is only valid for a few hours. Please keep in mind that updates to PHP from time to time break the building process of PHP. So if you download the latest snapshot and it fails to compile. Try downloading another snapshot a few hours later. PHP Snapshots.

Be sure and substitute the current URL you found on the snaps site into the following commands.

Get and uncompress the current PHP 5.2 source code.

cd ~/src
wget http://snaps.php.net/php5.2-200904151630.tar.gz
tar -xzf php5.2-200904151630.tar.gz
cd php5.2-200904151630

Configure and build PHP

./buildconf
./configure --prefix=/usr/local --enable-bcmath --enable-calendar --enable-ftp --enable-shmop --enable-sockets --enable-exif --with-apxs2=/usr/bin/apxs2 --with-openssl=/usr --with-mysql=/usr/ --with-ncurses=/usr --with-zlib --with-zlib-dir=/usr --with-ldap=/usr --with-kerberos=/usr --with-libxml-dir=/usr --with-gd --with-png-dir=/usr --with-jpeg-dir=/usr --with-freetype-dir=/usr --with-bz2=/usr/local --with-mcrypt=/usr --with-readline=/usr --with-curl=/usr --with-gettext=/usr --with-pgsql=/usr -with-interbase=/usr --with-xsl=/usr --enable-wddx --enable-zip --with-mime-magic --enable-mbstring --with-pspell=/usr --enable-inline-optimization --with-gmp --enable-pcntl --enable-sysvsem --enable-sysvshm --enable-sysvmsg --with-regex --enable-soap --with-mssql=/usr
make

# Run the tests

make test

Building PHP 5.3

Visit the PHP snaps site using your host to locate the URL for downloading the latest PHP 5.3 snapshot. This URL changes every few hours and is only valid for a few hours. Please keep in mind that updates to PHP from time to time break the building process of PHP. So if you download the latest snapshot and it fails to compile. Try downloading another snapshot a few hours later. PHP Snapshots.

Be sure and substitute the current URL you found on the snaps site into the following commands.

Get and uncompress the current PHP 5.3 source code.

cd ~/src
wget http://snaps.php.net/php5.3-200904151630.tar.gz
tar -xzf php5.3-200904151630.tar.gz
cd php5.3-200904151630

Configure and build PHP

./buildconf
./configure --prefix=/usr/local --enable-bcmath --enable-calendar --enable-ftp --enable-shmop --enable-sockets --enable-exif --with-apxs2=/usr/bin/apxs2 --with-openssl=/usr --with-mysql=/usr/ --with-zlib --with-zlib-dir=/usr --with-ldap=/usr --with-kerberos=/usr --with-libxml-dir=/usr --with-gd --with-png-dir=/usr --with-jpeg-dir=/usr --with-freetype-dir=/usr --with-bz2=/usr/local --with-mcrypt=/usr --with-readline=/usr --with-curl=/usr --with-gettext=/usr --with-pgsql=/usr -with-interbase=/usr --with-xsl=/usr --enable-wddx --enable-zip --enable-mbstring --with-pspell=/usr --enable-inline-optimization --with-gmp --enable-pcntl --enable-sysvsem --enable-sysvshm --enable-sysvmsg --with-regex --enable-soap --with-mssql=/usr
make

Run the tests

make test

Building PHP 6.0

Visit the PHP snaps site using your host to locate the URL for downloading the latest PHP 6.0 snapshot. This URL changes every few hours and is only valid for a few hours. Please keep in mind that updates to PHP from time to time break the building process of PHP. So if you download the latest snapshot and it fails to compile. Try downloading another snapshot a few hours later. PHP Snapshots.

Be sure and substitute the current URL you found on the snaps site into the following commands.

Get and uncompress the current PHP 6.0 source code.

cd ~/src
wget http://snaps.php.net/php6.0-200904151630.tar.gz
tar -xzf php6.0-200904151630.tar.gz
cd php6.0-200904151630

Configure and build PHP

./buildconf
./configure --prefix=/usr/local --enable-bcmath --enable-calendar --enable-ftp --enable-shmop --enable-sockets --enable-exif --with-apxs2=/usr/bin/apxs2 --with-openssl=/usr --with-mysql=/usr/ --with-zlib --with-zlib-dir=/usr --with-ldap=/usr --with-kerberos=/usr --with-libxml-dir=/usr --with-gd --with-png-dir=/usr --with-jpeg-dir=/usr --with-freetype-dir=/usr --with-bz2=/usr/local --with-mcrypt=/usr --with-readline=/usr --with-curl=/usr --with-gettext=/usr --with-pgsql=/usr -with-interbase=/usr --with-xsl=/usr --enable-wddx --enable-zip --enable-mbstring --with-pspell=/usr --enable-inline-optimization --with-gmp --enable-pcntl --enable-sysvsem --enable-sysvshm --enable-sysvmsg --with-regex --enable-soap --with-mssql=/usr
make

Run the tests

make test