← 返回命令列表

Linux command

php-build 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

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]

说明

php-build builds PHP versions from source for use with phpenv or standalone. It handles downloading, configuring, compiling, and installing multiple PHP versions, including selecting the correct OpenSSL/curl/ICU dependencies and applying patches for older releases. It is normally invoked via phpenv install but can also be run directly to install a PHP version into any prefix.

参数

--definitions
List available versions.
-v
Verbose mode.
-i _file_
Read custom definitions.
--pear
Install PEAR.

FAQ

What is the php-build command used for?

php-build builds PHP versions from source for use with phpenv or standalone. It handles downloading, configuring, compiling, and installing multiple PHP versions, including selecting the correct OpenSSL/curl/ICU dependencies and applying patches for older releases. It is normally invoked via phpenv install but can also be run directly to install a PHP version into any prefix.

How do I run a basic php-build example?

Run `php-build --definitions` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --definitions do in php-build?

List available versions.