Giter Club home page Giter Club logo

php-build's Introduction

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 Executable
  • bin/pyrus, a Pyrus environment scoped 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.
  • pyrus/, here are the source files of PEAR packages located which were installed via pyrus. The executables of PEAR packages are put in the bin/ folder (not in pear/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 a install_pyrus command which downloads a pyrus.phar and sets up a Pyrus install local to this prefix
  • xdebug, 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.

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: 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_DEBUG, set this to yes to trigger a set -x call. This echo's all issued shell commands of the script.

COPYRIGHT

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

php-build's People

Contributors

chh avatar loicfrering avatar zinrai avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.