序号

扩展

说明

配置参数

备注

1

BCMath

对于任意精度的数学,

如果有足够多的内存,PHP 提供的 BCMath 支持用字符串的形式表示任意大小和精度的数字

--enable-bcmath

2

Bzip2

bzip2 函数用于透明地读写 bzip2(.bz2)压缩文件。

--with-bz2[=DIR]

3

Calendar

Calendar

扩展提供了一系列用于简化不同历法间格式转换的函数

--enable-calendar

4

Ctype

该扩展所提供的函数用来检测 在当前的区域设定下(参见

setlocale())检查字符或者字符串 是否仅包含指定类型的字符。

--disable-ctype 

5

cURL

PHP 支持 Daniel Stenberg 创建的

libcurl 库,能够连接通讯各种服务器、使用各种协议

 --with-curl[=DIR]

DIR 为包含 lib 和 include 的目录路径。在

include 目录中必须有一个名为 curl,包含了 easy.h 和 curl.h 的文件夹。lib 文件夹里应该有一个名为 libcurl.a 的文件。

6

GD

要想在 PHP 中使用图像处理功能,你需要连带 GD

库一起来编译 PHP。 GD 库和 PHP 可能需要其他的库, 这取决于你要处理的图像格式。

 --with-gd[=DIR]

DIR 是 GD 的基本安装目录。要使用推荐的绑定的 GD

库版本,使用 --with-gd。要编译 GD 库,需要libpng 和 libjpeg。自 PHP 7.4.0 起,--with-gd 变为 --enable-gd (是否启用扩展) 和 --with-external-gd (选择使用外部 libgd,而不是绑定的)

7

IMAP

这些函数提供了可以操作 IMAP 以及 NNTP,POP3

和本地邮箱的方法。

--with-imap[=DIR]

DIR

表示c-client安装前缀。比如上面提到的例子中,你可以使用 --with-imap=/usr/local/imap-2000b. 根据以上描述,这个路径是指向你先前创建的文件夹。对于 Windows 用户,应该在 php.ini 文件中引入php_imap.dll.

8

LDAP

LDAP is the Lightweight

Directory Access Protocol, and is a protocol used to access "Directory Servers". The Directory is a special kind of database that holds information in a tree structure.

 --with-ldap[=DIR] 

DIR is the LDAP base install

directory. To enable SASL support, be sure --with-ldap-sasl[=DIR] is used, and that sasl.h exists on the system.

9

LIBXML

 the following core extensions rely on this

libxml extension: DOM, libxml, SimpleXML, SOAP, WDDX, XSL, XML, XMLReader, XMLRPC 和 XMLWriter.

 --disable-libxml

The libxml extension is enabled

by default, although it may be disabled with --disable-libxml.The optional --with-libxml-dir directive is used to specify the location of libxml on the system that PHP is being compiled on

10

MySQLi

mysqli 扩展允许访问 MySQL 4.1

及以上版本提供的功能

--with-mysqli

11

Mysqlnd

MySQL Native Driver is a

replacement for the MySQL Client Library (libmysqlclient). MySQL Native Driver is part of the official PHP sources as of PHP 5.3.0.

--with-mysql=mysqlnd \

--with-mysqli=mysqlnd \

--with-pdo-mysql=mysqlnd

In order to use the MySQL Native

Driver, PHP needs to be built specifying that the MySQL database extensions are compiled with MySQL Native Driver support. This is done through configuration options prior to building the PHP source code.

12

OpenSSL

OpenSSL 库来对称/非对称加解密,以及 PBKDF2、

PKCS7、 PKCS12、 X509 和其他加密操作

--with-openssl[=DIR]

13

PostgreSQL

PostgreSQL database is an Open

Source product and available without cost

--with-pgsql[=DIR]

DIR 是 PostgreSQL 的基本安装目录,默认是

/usr/local/pgsql。如果共享对象模块可用,可以使用 php.ini 中的 extension 指令或者 dl() 函数加载 PostgreSQL 模块。

14

zip

此扩展可以让你透明地读写ZIP压缩文档以及它们里面的文件。

--with-zip

从 PHP 7.4.0 开始,必须在编译 PHP 时用

--with-zip 配置选项来提供 zip 支持。之前的 PHP 版本,需要使用 --enable-zip 选项。

从 PHP 5.6.0 开始,添加了一个选项 --with-libzip=DIR 用来指定系统的 libzip 目录。要求 libzip 最低版本为 0.11,推荐使用 0.11.2 及以上版本。

15

ZLIB

This module enables you to

transparently read and write gzip (.gz) compressed files, through versions of most of the filesystem functions which work with gzip-compressed files (and uncompressed files, too, but not with sockets).

--with-zlib[=DIR]

Zlib support in PHP is not

enabled by default. You will need to configure PHP

SAPI modules:

  --with-apxs2[=FILE]

Build shared Apache 2 handler module. FILE is the optional pathname to the Apache apxs tool [apxs]

  --disable-cli

Disable building CLI version of PHP (this forces --without-pear)

  --enable-embed[=TYPE] 

 EXPERIMENTAL: Enable building of embedded

SAPI  library TYPE is either 'shared' or 'static'.

[TYPE=shared]

  --enable-fpm

Enable building of the fpm SAPI executable

  --with-fpm-user[=USER]

Set the user for php-fpm to run as. (default: nobody)

  --with-fpm-group[=GRP]

Set the group for php-fpm to run as. For a system user, this should usually be set to match the fpm username (default: nobody)

  --with-fpm-systemd

Activate systemd integration

  --with-fpm-acl

Use POSIX Access Control Lists

  --with-fpm-apparmor

Support AppArmor confinement through libapparmor

  --with-fpm-selinux 

Support SELinux policy library

  --enable-fuzzer 

Build PHP as clang fuzzing test module (for developers))

  --enable-litespeed 

Build PHP as litespeed module

  --enable-phpdbg 

Build phpdbg

  --enable-phpdbg-debug 

Build phpdbg in debug mode

  --enable-phpdbg-readline

Enable readline support in phpdbg (depends

on static  ext/readline))

  --disable-cgi 

Disable building CGI version of PHP

  --with-valgrind 

Enable valgrind support

General settings:

  --enable-gcov 

Enable GCOV code coverage - FOR DEVELOPERS ONLY!!

  --enable-debug 

Compile with debugging symbols

  --enable-debug-assertions

Compile with debug assertions even in release mode

  --enable-zts 

Enable thread safety

  --enable-rtld-now 

Use dlopen with RTLD_NOW instead of RTLD_LAZY

  --with-layout=TYPE 

Set how installed files will be laid out. Type can be either PHP or GNU [PHP]

  --with-config-file-path=PATH

Set

the path in which to look for php.ini [PREFIX/lib]

  --with-config-file-scan-dir=PATH

Set the path where to scan for configuration files

  --enable-sigchild 

Enable PHP's own SIGCHLD handler

  --enable-libgcc 

Enable explicitly linking against libgcc

  --disable-short-tags 

Disable the short-form <? start tag by default

  --enable-dmalloc 

Enable dmalloc

  --disable-ipv6 

Disable IPv6 support

  --enable-dtrace 

Enable DTrace support

  --enable-fd-setsize 

Set size of descriptor sets

  --enable-werror 

Enable -Werror

  --enable-memory-sanitizer

Enable memory sanitizer (clang only)

  --enable-address-sanitizer

Enable address sanitizer

  --enable-undefined-sanitizer

Enable undefined sanitizer

Extensions:

  --with-EXTENSION=shared[,PATH]

NOTE:

Not all extensions can be build as 'shared'.

  Example: --with-foobar=shared,/usr/local/foobar/

      o Builds the foobar extension as shared extension.

      o foobar package install prefix is /usr/local/foobar/

  --disable-all 

Disable all extensions which are enabled by default

  --without-libxml 

Build without LIBXML support

  --with-openssl 

Include OpenSSL support (requires OpenSSL >= 1.0.2)

  --with-kerberos 

OPENSSL: Include Kerberos support

  --with-system-ciphers 

OPENSSL: Use system default cipher list instead of hardcoded value

  --with-external-pcre 

Use external library for PCRE support

  --without-pcre-jit 

Disable PCRE JIT functionality

  --without-sqlite3 

Do not include SQLite3 support.

  --with-zlib 

Include ZLIB support requires zlib >= 1.2.0.4)

  --enable-bcmath 

Enable bc style precision math functions

  --with-bz2[=DIR] 

Include BZip2 support

  --enable-calendar 

Enable support for calendar conversion

  --disable-ctype 

Disable ctype functions

  --with-curl 

Include cURL support

  --enable-dba 

Build DBA with bundled modules. To build shared DBA extension use --enable-dba=shared

  --with-qdbm[=DIR] 

DBA: QDBM support

  --with-gdbm[=DIR] 

DBA: GDBM support

  --with-ndbm[=DIR] 

DBA: NDBM support

  --with-db4[=DIR] 

DBA: Oracle Berkeley DB 4.x or 5.x support

  --with-db3[=DIR] 

DBA: Oracle Berkeley DB 3.x support

  --with-db2[=DIR] 

DBA: Oracle Berkeley DB 2.x support

  --with-db1[=DIR] 

DBA: Oracle Berkeley DB 1.x support/emulation

  --with-dbm[=DIR] 

DBA: DBM support

  --with-tcadb[=DIR] 

DBA: Tokyo Cabinet abstract DB support

  --with-lmdb[=DIR] 

DBA: Lightning memory-mapped database support

  --without-cdb[=DIR] 

DBA: CDB support (bundled)

  --disable-inifile 

DBA: INI support (bundled)

  --disable-flatfile 

DBA: FlatFile support (bundled)

  --enable-dl-test 

Enable dl_test extension

  --disable-dom 

Disable DOM support

  --with-enchant 

Include Enchant support

  --enable-exif 

Enable EXIF (metadata from images) support

  --with-ffi 

Include FFI support

  --disable-fileinfo 

Disable fileinfo support

  --disable-filter 

Disable input filter support

  --enable-ftp 

Enable FTP support

  --with-openssl-dir 

FTP: Whether to enable FTP SSL support without ext/openssl

  --enable-gd 

Include GD support

  --with-external-gd 

Use external libgd

  --with-avif 

GD: Enable AVIF support (only for bundled libgd)

  --with-webp 

GD: Enable WEBP support (only for bundled libgd)

  --with-jpeg 

GD: Enable JPEG support (only for bundled libgd)

  --with-xpm 

GD: Enable XPM support (only for bundled libgd)

  --with-freetype 

GD: Enable FreeType 2 support (only for bundled  libgd)

  --enable-gd-jis-conv 

GD: Enable JIS-mapped Japanese font support (only for bundled libgd)

  --with-gettext[=DIR] 

Include GNU gettext support

  --with-gmp[=DIR] 

Include GNU MP support

  --with-mhash 

Include mhash support

  --without-iconv[=DIR] 

Exclude iconv support

  --with-imap[=DIR] 

Include IMAP support. DIR is the c-client install prefix

  --with-kerberos 

IMAP: Include Kerberos support

  --with-imap-ssl 

IMAP: Include SSL support

  --enable-intl 

Enable internationalization support

  --with-ldap[=DIR] 

Include LDAP support

  --with-ldap-sasl 

LDAP: Build with Cyrus SASL support

  --enable-mbstring 

Enable multibyte string support

  --disable-mbregex 

MBSTRING: Disable multibyte regex support

  --with-mysqli 

Include MySQLi support. The MySQL native driver will  be used

  --with-mysql-sock[=SOCKPATH]

 MySQLi/PDO_MYSQL: Location of the MySQL unix

socket pointer. If unspecified, the default locations are searched

  --with-oci8[=DIR] 

Include Oracle Database OCI8 support. DIR defaults to $ORACLE_HOME. Use --with-oci8=instantclient,/path/to/instant/client/lib to use an Oracle Instant Client installation

  --with-odbcver[=HEX] 

Force support for the passed ODBC version. A hex number is expected, default 0x0350. Use the special value of 0 to prevent an explicit ODBCVER to be defined.

  --with-adabas[=DIR] 

Include Adabas D support [/usr/local]

  --with-sapdb[=DIR] 

Include SAP DB support [/usr/local]

  --with-solid[=DIR] 

Include Solid support [/usr/local/solid]

  --with-ibm-db2[=DIR] 

Include IBM DB2 support [/home/db2inst1/sqllib]

  --with-empress[=DIR] 

Include Empress support $EMPRESSPATH (Empress Version >= 8.60 required))

  --with-empress-bcs[=DIR]

 Include Empress Local Access support

$EMPRESSPATH(Empress Version >= 8.60 required)

  --with-custom-odbc[=DIR]

    Include user defined ODBC support. DIR is

ODBC

                          install base directory [/usr/local]. Make sure to

                          define CUSTOM_ODBC_LIBS and have some odbc.h in your

                          include dirs. For example, you should define

                          following for Sybase SQL Anywhere 5.5.00 on QNX,

                          prior to running this configure script:

                          CPPFLAGS="-DODBC_QNX -DSQLANY_BUG" LDFLAGS=-lunix

                          CUSTOM_ODBC_LIBS="-ldblib -lodbc"

  --with-iodbc 

Include iODBC support

  --with-esoob[=DIR] 

Include Easysoft OOB support [/usr/local/easysoft/oob/client]

  --with-unixODBC 

Include unixODBC support

  --with-dbmaker[=DIR] 

Include DBMaker support

  --disable-opcache 

Disable Zend OPcache support

  --disable-huge-code-pages

Disable copying PHP CODE pages into HUGE PAGES

  --disable-opcache-jit 

Disable JIT

  --enable-pcntl 

Enable pcntl support (CLI/CGI only)

  --disable-pdo 

Disable PHP Data Objects support

  --with-pdo-dblib[=DIR] 

PDO: DBLIB-DB support. DIR is the FreeTDS home    directory

  --with-pdo-firebird[=DIR]

PDO: Firebird support. DIR is the Firebird base install directory [/opt/firebird]

  --with-pdo-mysql[=DIR] 

PDO: MySQL support. DIR is the MySQL base directory. If no value or mysqlnd is passed as DIR, the MySQL  native driver will be used

  --with-zlib-dir[=DIR] 

PDO_MySQL: Set the path to libz install prefix

  --with-pdo-oci[=DIR] 

PDO: Oracle OCI support. DIR defaults to $ORACLE_HOME. Use  --with-pdo-oci=instantclient,/path/to/instant/client/lib for an Oracle Instant Client installation.

  --with-pdo-odbc=flavour,dir

PDO: Support for 'flavour' ODBC driver. The include and lib dirs are looked for under 'dir'. The 'flavour' can be one of: ibm-db2, iODBC, unixODBC,generic. If ',dir' part is omitted, default for the flavour you have selected will be used. e.g.:  --with-pdo-odbc=unixODBC will check for unixODBC under /usr/local. You may attempt to use an otherwise unsupported driver using the 'generic' flavour. The syntax for generic ODBC support is:  --with-pdo-odbc=generic,dir,libname,ldflags,cflags. When built as 'shared' the extension filename is always pdo_odbc.so

  --with-pdo-pgsql[=DIR] 

PDO: PostgreSQL support. DIR is the PostgreSQL base

   

install directory or the path to pg_config

  --without-pdo-sqlite 

PDO: sqlite 3 support.

  --with-pgsql[=DIR] 

Include PostgreSQL support. DIR is the PostgreSQL

   

base install directory or the path to pg_config

  --disable-phar 

Disable phar support

  --disable-posix 

Disable POSIX-like functions

  --with-pspell[=DIR] 

Include PSPELL support. GNU Aspell version 0.50.0 or

   

higher required

  --with-libedit 

Include libedit readline replacement (CLI/CGI only)

  --with-readline[=DIR] 

Include readline support (CLI/CGI only)

  --disable-session 

Disable session support

  --with-mm[=DIR] 

SESSION: Include mm support for session storage

  --enable-shmop 

Enable shmop support

  --disable-simplexml 

Disable SimpleXML support

  --with-snmp[=DIR] 

Include SNMP support

  --enable-soap 

Enable SOAP support

  --enable-sockets 

Enable sockets support

  --with-sodium 

Include sodium support

  --with-external-libcrypt

Use external libcrypt or libxcrypt

  --with-password-argon2 

Include Argon2 support in password_*

  --enable-sysvmsg 

Enable sysvmsg support

  --enable-sysvsem 

Enable System V semaphore support

  --enable-sysvshm 

Enable the System V shared memory support

  --with-tidy[=DIR] 

Include TIDY support

  --disable-tokenizer 

Disable tokenizer support

  --disable-xml 

Disable XML support

  --with-expat 

XML: use expat instead of libxml2

  --disable-xmlreader 

Disable XMLReader support

  --disable-xmlwriter 

Disable XMLWriter support

  --with-xsl 

Build with XSL support

  --enable-zend-test 

Enable zend_test extension

  --with-zip 

Include Zip read/write support

  --enable-mysqlnd 

Enable mysqlnd explicitly, will be done implicitly when required by other extensions

  --disable-mysqlnd-compression-support

  Disable support for the MySQL compressed

protocol in mysqlnd

PEAR:

  --with-pear[=DIR] 

Install PEAR in DIR [PREFIX/lib/php]

  --disable-fiber-asm 

Disable the use of boost fiber assembly files