Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Builds PHP so that multiple versions can be used side by side.
Shell Groff
Latest commit 060affd @GrahamCampbell GrahamCampbell Merge pull request #343 from hnw/normalize-environment-variable-name
Normalize environment variable name inconsistency

php-build Build Status

php-build is a utility for building versions of PHP to use them side by side with each other. The overall structure is loosly borrowed from Sam Stephenson's ruby-build.

Do you like php-build? You can buy me a beer by Gittipp-ing. Consider also Gittipp-ing one of the awesome contributors.



Install standalone php-build

Clone the Git Repository:

% git clone git://

Then go into the extracted/cloned directory and run:

% ./

This installs php-build to the default prefix /usr/local.

To install php-build to an other location than /usr/local set the PREFIX environment variable:

% PREFIX=$HOME/local ./

If you don't have permissions to write to the prefix, then you have to run as superuser, either via su -c or via sudo.

Install with phpenv

Locate your phpenv directory:

% ls $HOME/.phpenv

Clone the Git repository into phpenv plugins directory:

% git clone git:// $HOME/.phpenv/plugins/php-build

Now you can use php-build as phpenv plugin, as follows:

% phpenv install <definition>

The built version will be installed into $HOME/.phpenv/versions/<definition>.


Issue reports and pull requests are always welcome.

All contributions will be reviewed and merged by the core team:





php-build is released under the MIT License.

Something went wrong with that request. Please try again.