1. php-build(1)
  2. php-build
  3. php-build(1)

NAME

php-build - Builds PHP versions with their coexistence in mind.

SYNOPSIS

php-build --definitions
php-build [-i|--ini env] [--pear] 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:

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:

For more information about the definition file format see php-build(5).

pear vs. pyrus

Currently Pyrus is provided as the default installer for PEAR packages in the shipped definitions.

To install the old "pear" tool alongside of Pyrus, add the --pear flag on the command line, right after the --ini switch. This is considered experimental!

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
Tells php-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.

ENVIRONMENT

php-build is Copyright (C) 2011 Christoph Hochstrasser http://christophh.net.

  1. php-build 0.9.0-beta2
  2. April 2012
  3. php-build(1)