php-build(1) -- Builds PHP versions with their coexistence in mind.
SYNOPSIS
php-build
--definitions
php-build
[-i
|--ini
env] definition prefix
DESCRIPTION
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/php
, The PHP Executablebin/pyrus
, a Pyrus environment scoped to this PHP versionetc/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 viapear
located.pyrus/
, here are the source files of PEAR packages located which were installed viapyrus
. The executables of PEAR packages are put in thebin/
folder (not inpear/bin
). This directory is configured as include path for PHP.
Definitions
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 ainstall_pyrus
command which downloads apyrus.phar
and sets up a Pyrus install local to this prefixxdebug
, Provides theinstall_xdebug
version andinstall_xdebug_master
commands. Useinstall_xdebug_master
for building development versions of PHP andinstall_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 forconfigure
. 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.
pear vs. pyrus
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
.
OPTIONS
--definitions
: Lists all definitions, which are available to build.-i
env,--ini
env: Tellsphp-build
to use thephp.ini
-env from the PHP source archive. Typically you would use eitherproduction
ordevelopment
. Creates an emptyphp.ini
by default.
ENVIRONMENT
PHP_BUILD_DEBUG
, set this toyes
to trigger aset -x
call. This echo's all issued shell commands of the script.
COPYRIGHT
php-build is Copyright (C) 2011 Christoph Hochstrasser http://christophh.net.