Skip to content

依赖关系图表

在编译 PHP 时,每个扩展、库都有依赖关系,这些依赖关系可能是必需的,也可能是可选的。在编译 PHP 时,可以选择是否包含这些可选的依赖关系。

例如,在 Linux 下编译 gd 扩展时,会强制编译 zlib,libpng 库和 zlib 扩展,而 libavif,libwebp,libjpeg,freetype 库都是可选的库,默认不会编译,除非通过 --with-libs=avif,webp,jpeg,freetype 选项指定。

  • 对于可选扩展(扩展的可选特性),需手动在编译时指定,例如启用 Redis 的 igbinary 支持:bin/spc build redis,igbinary
  • 对于可选库,需通过 --with-libs=XXX 选项编译指定。
  • 如果想启用所有的可选扩展,可以使用 bin/spc build redis --with-suggested-exts 参数。
  • 如果想启用所有的可选库,可以使用 --with-suggested-libs 参数。

扩展的依赖图

Linux

Extension NameRequired ExtensionsSuggested ExtensionsRequired LibrariesSuggested Libraries
amqplibrabbitmq
bz2bzip2
curlcurl
dbaqdbm
domlibxml2
zlib
eventopensslsocketslibevent
ftpopenssl
gdzlibzlib
libpng
libavif
libwebp
libjpeg
freetype
gettextgettext
gmpgmp
gmsslgmssl
iconvlibiconv
igbinarysession
apcu
imagickimagemagick
imapopensslimap
intlicu
ldapopensslldapgmp
libsodium
libxmlxml
mbregexmbstringonig
memcachesessionzlib
mongodbicu
openssl
zstd
zlib
mysqlimysqlnd
mysqlndzlib
opensslzlibopenssl
zlib
password-argon2libargon2
pdo_mysqlpdo
mysqlnd
pdo_pgsqlpdo
pgsql
postgresql
pdo_sqlitepdo
sqlite3
sqlite
pdo_sqlsrvpdo
sqlsrv
pgsqlpostgresql
pharzlib
readlinereadline
redissession
igbinary
zstd
liblz4
simplexmllibxml2
snappyapcusnappy
soaplibxml2
sodiumlibsodium
spxzlib
sqlite3sqlite
sqlsrvpcntlunixodbc
ssh2libssh2
swooleopenssl
curl
swoole-hook-pgsql
swoole-hook-mysql
swoole-hook-sqlite
libcares
brotli
nghttp2
zlib
swoole-hook-mysqlmysqlnd
pdo
pdo_mysql
mysqli
swoole-hook-pgsqlpgsql
pdo
swoole-hook-sqlitesqlite3
pdo
swowopenssl
curl
openssl
curl
tidytidy
uuidlibuuid
uvsocketslibuv
xhprofctype
xlswriterzlib
zip
openssl
xmllibxml2
xmlreaderlibxml2
xmlwriterlibxml2
xslxml
dom
libxslt
yacigbinary
yamllibyaml
ziplibzip
zlibzlib
zstdzstd

macOS

Extension NameRequired ExtensionsSuggested ExtensionsRequired LibrariesSuggested Libraries
amqplibrabbitmq
bz2bzip2
curlcurl
dbaqdbm
domlibxml2
zlib
eventopensslsocketslibevent
ffilibffi
ftpopenssl
gdzlibzlib
libpng
libavif
libwebp
libjpeg
freetype
gettextgettext
glfwglfw
gmpgmp
gmsslgmssl
iconvlibiconv
igbinarysession
apcu
imagickimagemagick
imapopensslimap
intlicu
ldapopensslldapgmp
libsodium
libxmlxml
mbregexmbstringonig
memcachesessionzlib
memcachedsession
zlib
libmemcached
mongodbicu
openssl
zstd
zlib
mysqlimysqlnd
mysqlndzlib
opensslzlibopenssl
zlib
password-argon2libargon2
pdo_mysqlpdo
mysqlnd
pdo_pgsqlpdo
pgsql
postgresql
pdo_sqlitepdo
sqlite3
sqlite
pdo_sqlsrvpdo
sqlsrv
pgsqlpostgresql
pharzlib
readlinereadline
redissession
igbinary
zstd
liblz4
simplexmllibxml2
snappyapcusnappy
soaplibxml2
sodiumlibsodium
spxzlib
sqlite3sqlite
sqlsrvunixodbc
ssh2libssh2
swooleopenssl
curl
swoole-hook-pgsql
swoole-hook-mysql
swoole-hook-sqlite
libcares
brotli
nghttp2
zlib
swoole-hook-mysqlmysqlnd
pdo
pdo_mysql
mysqli
swoole-hook-pgsqlpgsql
pdo
swoole-hook-sqlitesqlite3
pdo
swowopenssl
curl
openssl
curl
tidytidy
uuidlibuuid
uvsocketslibuv
xhprofctype
xlswriterzlib
zip
openssl
xmllibxml2
xmlreaderlibxml2
xmlwriterlibxml2
xslxml
dom
libxslt
yacigbinary
yamllibyaml
ziplibzip
zlibzlib
zstdzstd

Windows

Extension NameRequired ExtensionsSuggested ExtensionsRequired LibrariesSuggested Libraries
amqpopenssllibrabbitmq
bz2bzip2
curlzlib
openssl
curl
dbaqdbm
domxmllibxml2
zlib
ffilibffi-win
ftpopenssl
gdzlibzlib
libpng
libavif
libwebp
libjpeg
freetype
gmsslgmssl
iconvlibiconv-win
igbinarysession
apcu
libxmlxml
mbregexmbstringonig
mysqlimysqlnd
mysqlndzlib
opensslzlibopenssl
zlib
parallelpthreads4w
pdo_mysqlpdo
mysqlnd
pdo_sqlitepdo
sqlite3
sqlite
pdo_sqlsrvpdo
sqlsrv
pharzlib
redissession
igbinary
simplexmlxmllibxml2
soapxmllibxml2
sqlite3sqlite
ssh2openssl
zlib
libssh2
swowopenssl
curl
openssl
curl
xmliconvlibxml2
xmlreaderxml
dom
libxml2
xmlwriterxmllibxml2
yamllibyaml
zipzlib
bz2
libzip
zlib
bzip2
xz
zlibzlib

FreeBSD

Extension NameRequired ExtensionsSuggested ExtensionsRequired LibrariesSuggested Libraries
bz2bzip2
curlcurl
dbaqdbm
ftpopenssl
mbregexmbstringonig
mysqlimysqlnd
mysqlndzlib
opensslzlibopenssl
zlib
pdo_mysqlpdo
mysqlnd
pharzlib
zlibzlib

库的依赖表

Linux

Library NameRequired LibrariesSuggested Libraries
curlopenssl
zlib
libssh2
brotli
nghttp2
zstd
libcares
freetypezliblibpng
bzip2
brotli
gettextlibiconvncurses
libxml2
imagemagickzlib
libpng
libjpeg
libwebp
freetype
libtiff
zstd
xz
bzip2
libzip
libxml2
imapopenssl
ldapopenssl
zlib
gmp
libsodium
libeventopenssl
libpngzlib
librabbitmqopenssl
libssh2opensslzlib
libxml2libiconvxz
icu
zlib
libxsltlibxml2
libzipzlibbzip2
xz
zstd
openssl
nghttp2zlib
openssl
libxml2
opensslzlib
postgresqllibiconv
libxml2
openssl
zlib
readline
icu
libxslt
ldap
zstd
readlinencurses
snappyzlib
unixodbclibiconv
xzlibiconv

macOS

Library NameRequired LibrariesSuggested Libraries
curlopenssl
zlib
libssh2
brotli
nghttp2
zstd
libcares
freetypezliblibpng
bzip2
brotli
gettextlibiconvncurses
libxml2
imagemagickzlib
libpng
libjpeg
libwebp
freetype
libtiff
zstd
xz
bzip2
libzip
libxml2
imapopenssl
ldapopenssl
zlib
gmp
libsodium
libeventopenssl
libpngzlib
librabbitmqopenssl
libssh2opensslzlib
libxml2libiconvxz
icu
zlib
libxsltlibxml2
libzipzlibbzip2
xz
zstd
openssl
nghttp2zlib
openssl
libxml2
opensslzlib
postgresqllibiconv
libxml2
openssl
zlib
readline
icu
libxslt
ldap
zstd
readlinencurses
snappyzlib
unixodbclibiconv
xzlibiconv

Windows

Library NameRequired LibrariesSuggested Libraries
curlopenssl
zlib
libssh2
nghttp2
brotli
zstd
freetypezliblibpng
bzip2
brotli
libjpegzlib
libpngzlib
librabbitmqopenssl
libssh2opensslzlib
libxml2libiconv-winzlib
libzipzlib
bzip2
xz
zstd
openssl
nghttp2zlib
openssl
libxml2
opensslzlib

FreeBSD

Library NameRequired LibrariesSuggested Libraries
curlopenssl
zlib
libssh2
brotli
nghttp2
zstd
libcares
opensslzlib

Released under the MIT License.