php-build
TLDR
List available PHP versions
$ php-build --definitions
Install PHP version$ php-build [8.2.0] [~/.phpenv/versions/8.2.0]
Install with configure options$ PHP_BUILD_CONFIGURE_OPTS="--with-openssl" php-build [8.2.0] [/path/to/install]
Install specific version with debug$ php-build -v [8.2.0] [/path/to/install]
SYNOPSIS
php-build [options] version install-path
DESCRIPTION
php-build builds PHP versions from source for use with phpenv or standalone. It handles downloading, configuring, compiling, and installing multiple PHP versions.
PARAMETERS
--definitions
List available versions.-v
Verbose mode.-i file
Read custom definitions.--pear
Install PEAR.
EXAMPLES
$ # List versions
php-build --definitions
# Install PHP 8.2
php-build 8.2.0 ~/.phpenv/versions/8.2.0
# With extensions
PHP_BUILD_CONFIGURE_OPTS="--with-curl --with-openssl" \
php-build 8.1.0 /opt/php-8.1.0
# Install with verbose output
php-build -v 8.2.5 ~/.php/8.2.5
php-build --definitions
# Install PHP 8.2
php-build 8.2.0 ~/.phpenv/versions/8.2.0
# With extensions
PHP_BUILD_CONFIGURE_OPTS="--with-curl --with-openssl" \
php-build 8.1.0 /opt/php-8.1.0
# Install with verbose output
php-build -v 8.2.5 ~/.php/8.2.5
ENVIRONMENT
$ PHP_BUILD_CONFIGURE_OPTS # Extra configure options
PHP_BUILD_EXTRA_MAKE_ARGUMENTS # Extra make arguments
PHP_BUILD_ROOT # Build directory
PHP_BUILD_EXTRA_MAKE_ARGUMENTS # Extra make arguments
PHP_BUILD_ROOT # Build directory
CAVEATS
Compilation takes time. Requires build dependencies. Used with phpenv for version management.
HISTORY
php-build is part of the phpenv ecosystem, inspired by ruby-build, for managing multiple PHP versions.


