php-build
- Builds PHP versions with their coexistence in mind.
php-build
--definitions
php-build
[-i
|--ini
env] definition prefix
php-build
builds common PHP versions so, that they
can be used side by side in a development environment.
php-build
works with written definitions for each
PHP version which you want to build. These definitions
typically include directives, which tell where to download
the source package, which XDebug version to use (if any)
or add/remove/replace specific build options.
To list all available definitions pass the --definitions
flag. Definitions are looked up in share/php-build/definitions
.
To build a definition pass it as the definition argument and the path where you want to place the compiled artifacts as prefix argument.
The definition argument either expects a definition name as
listed by --definitions
, or a path to the definition file you
want to use.
Important: You cannot move the prefix folder afterwards. All paths are written absolute to all generated configs and executables!
For example to build PHP 5.4.0beta2 into your ~/local
folder with development configuration:
$ php-build --ini development 5.4.0beta2 ~/local/5.4.0beta2
Here is a quick overview of what is stored where:
bin/
, Contains the PHP executables and all executables installed via pear
or pyrus
.bin/php
, The PHP Executablebin/pyrus
, a Pyrus executable, which installs packages local to this PHP version.bin/pear
, a PEAR executable, which installs packages local to this PHP version.etc/php.ini
etc/conf.d/
, PHP is configured to look for additional
.ini
files in this directory. Place your extension's
config files or your config overrides here.pear/
, here are PHP source files of PEAR packages installed
via pear
located.share/pyrus/.pear/php
, here are the source files of PEAR packages located
which were installed via pyrus
. This is configured as Include Path.Definitions are the blueprints for building PHP versions. Definitions
are Shell Scripts, which call some predefined functions. Definitions are
stored in share/php-build/definitions
. php-build
ships with
definitions for common PHP releases starting with PHP 5.3. You can
take a look at these to get a feel for them.
php-build
defines utility functions for building a PHP source tarball
and manipulating config files. php-build
supports
plugins which provide additional functions for usage within
definitions. Plugins must have the extension .sh
and
are looked up in share/plugins.d
.
php-build
ships with these plugins:
pyrus
, Provides a install_pyrus
command which downloads
a pyrus.phar
and sets up a Pyrus install local to this prefixxdebug
, Provides the install_xdebug
version and
install_xdebug_master
commands. Use install_xdebug_master
for building development versions of PHP and install_xdebug
version for building stable releases.php-build
ships with these definition commands by default:
install_package
url, Downloads the source package from
the provided url, extract it and run the build process.
Please provide only urls to .bz2
files for now!configure_option
[-R]
[-D]
name value, by default adds
the option with name to the argument list for configure
. If a
value is passed, then it adds name=value to the argument list.
The -D
flag removes the option name from the argument list, and
the flag -R
, sets a new value for the existing option name.Currently Pyrus is provided as the default installer for PEAR packages in the shipped definitions.
If you want to use the pear
command for managing PEAR packages add
with_pear
before the call to install_package
. You should remove the
install_pyrus
from the definition, otherwise the include paths
will be messed up and installed executables will conflict as they both
install them to $PREFIX/bin
.
The pear
command installs PHP source files to $PREFIX/pear
and
executables to $PREFIX/bin
.
--definitions
-i
env, --ini
envphp-build
to use the php.ini
-env
from the PHP source archive. Typically you would
use either production
or development
. Creates an
empty php.ini
by default.PHP_BUILD_DEBUG
, set this to yes
to trigger a set -x
call. This echo's all issued shell commands of the script.PHP_BUILD_XDEBUG_ENABLE
, set to off
to comment out the
lines which enable XDebug, in the generated xdebug.ini
.php-build is Copyright (C) 2011 Christoph Hochstrasser http://christophh.net.