PHP from source
php-build compiles PHP from source and installs versions in parallel, standalone or as a phpenv plugin. Fully automatic.
Install 5.6 through 8.x at once and pin a version per project. No system-wide clobbering.
Compiles each release from source with your own configure options and build environment.
Drops in as a phpenv plugin so phpenv install just works, or run it fully standalone.
Version recipes live as definitions. List, extend, or add your own build targets.
Install
1. As a phpenv plugin — the installer wires up phpenv and php-build together:
$ curl -L https://raw.githubusercontent.com/phpenv/phpenv-installer/master/bin/phpenv-installer | bash
2. Standalone — clone and install to a prefix you control:
$ git clone https://github.com/php-build/php-build.git
$ cd php-build
$ PREFIX=$HOME/local ./install.sh
Usage
php-build --help
php-build --definitions
php-build [-i <environment_or_inifile>] <definition> <prefix>
Build 8.3.0 in development configuration into a chosen prefix:
$ php-build -i development 8.3.0 ~/local/php/8.3.0
Before your first build
$ sudo apt-get install -y \
autoconf bison re2c pkg-config \
libxml2-dev libssl-dev libcurl4-openssl-dev \
libreadline-dev libzip-dev libsqlite3-dev
$ brew install pkg-config autoconf \
openssl icu4c re2c bison libzip
Maintainers
Legal
php-build is released under the MIT License. Copyright © 2011–2015 Christoph Hochstrasser.
The MIT License (MIT) Copyright (c) 2011-2015 Christoph Hochstrasser Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.