Skip to content

# Dependency Table ​

When compiling PHP, each extension and library has dependencies, which may be required or optional. You can choose whether to include these optional dependencies.

For example, when compiling the `gd` extension under Linux, the `zlib,libpng` libraries and the `zlib` extension are forced to be compiled, while the `libavif,libwebp,libjpeg,freetype` libraries are optional libraries and will not be compiled by default unless specified by the `--with-libs=avif,webp,jpeg,freetype` option.

- For optional extensions (optional features of extensions), you need to specify them manually at compile time, for example, to enable igbinary support for Redis: `bin/spc build redis,igbinary`.
- For optional libraries, you need to compile and specify them through the `--with-libs=XXX` option.
- If you want to enable all optional extensions, you can use `bin/spc build redis --with-suggested-exts`.
- If you want to enable all optional libraries, you can use `--with-suggested-libs`.

## Extension Dependency Table ​

### Linux ​

Extension Name | Required Extensions | Suggested Extensions | Required Libraries | Suggested Libraries
--- | --- | --- | --- | ---
amqp |  |  | librabbitmq |
brotli |  |  | brotli |
bz2 |  |  | bzip2 |
curl |  |  | curl |
dba |  |  |  | qdbm
dom |  |  | libxml2 zlib |
ev | sockets |  |  |
event | openssl | sockets | libevent |
ffi |  |  | libffi |
ftp |  |  |  | openssl
gd | zlib |  | zlib libpng | libavif libwebp libjpeg freetype
gettext |  |  | gettext |
gmp |  |  | gmp |
gmssl |  |  | gmssl |
grpc |  |  | grpc |
iconv |  |  | libiconv |
igbinary |  | session apcu |  |
imagick |  |  | imagemagick |
imap |  | openssl | imap |
intl |  |  | icu |
ldap |  | openssl | ldap | gmp libsodium
lz4 |  |  | liblz4 |
mbregex | mbstring |  | onig |
memcache | zlib session |  |  |
memcached | session zlib |  | libmemcached fastlz |
mongodb |  |  |  | icu openssl zstd zlib
msgpack | session |  |  |
mysqli | mysqlnd |  |  |
mysqlnd |  |  | zlib |
odbc |  |  | unixodbc |
openssl | zlib |  | openssl zlib |
password-argon2 |  |  | libargon2 |
pdo_mysql | pdo mysqlnd |  |  |
pdo_odbc | pdo odbc |  | unixodbc |
pdo_pgsql | pdo pgsql |  | postgresql |
pdo_sqlite | pdo sqlite3 |  | sqlite |
pdo_sqlsrv | pdo sqlsrv |  |  |
pgsql |  |  | postgresql |
phar | zlib |  |  |
rdkafka |  |  | librdkafka |
readline |  |  | readline |
redis |  | session igbinary |  | zstd liblz4
simplexml |  |  | libxml2 |
snappy |  | apcu | snappy |
soap |  |  | libxml2 |
sodium |  |  | libsodium |
spx |  |  | zlib |
sqlite3 |  |  | sqlite |
sqlsrv | pcntl |  | unixodbc |
ssh2 | openssl zlib |  | libssh2 |
swoole | openssl curl | swoole-hook-pgsql swoole-hook-mysql swoole-hook-sqlite | libcares brotli nghttp2 zlib |
swoole-hook-mysql | mysqlnd pdo pdo_mysql | mysqli |  |
swoole-hook-pgsql | pgsql pdo |  |  |
swoole-hook-sqlite | sqlite3 pdo |  |  |
swow |  | openssl curl |  | openssl curl
tidy |  |  | tidy |
uuid |  |  | libuuid |
uv | sockets |  | libuv |
xhprof | ctype |  |  |
xlswriter | zlib zip |  |  | openssl
xml |  |  | libxml2 |
xmlreader |  |  | libxml2 |
xmlwriter |  |  | libxml2 |
xsl | xml dom |  | libxslt |
xz |  |  | xz |
yac | igbinary |  | fastlz |
yaml |  |  | libyaml |
zip |  |  | libzip |
zlib |  |  | zlib |
zstd |  |  | zstd |

### macOS ​

Extension Name | Required Extensions | Suggested Extensions | Required Libraries | Suggested Libraries
--- | --- | --- | --- | ---
amqp |  |  | librabbitmq |
brotli |  |  | brotli |
bz2 |  |  | bzip2 |
curl |  |  | curl |
dba |  |  |  | qdbm
dom |  |  | libxml2 zlib |
ev | sockets |  |  |
event | openssl | sockets | libevent |
ffi |  |  | libffi |
ftp |  |  |  | openssl
gd | zlib |  | zlib libpng | libavif libwebp libjpeg freetype
gettext |  |  | gettext |
glfw |  |  | glfw |
gmp |  |  | gmp |
gmssl |  |  | gmssl |
grpc |  |  | grpc |
iconv |  |  | libiconv |
igbinary |  | session apcu |  |
imagick |  |  | imagemagick |
imap |  | openssl | imap |
intl |  |  | icu |
ldap |  | openssl | ldap | gmp libsodium
lz4 |  |  | liblz4 |
mbregex | mbstring |  | onig |
memcache | zlib session |  |  |
memcached | session zlib |  | libmemcached fastlz |
mongodb |  |  |  | icu openssl zstd zlib
msgpack | session |  |  |
mysqli | mysqlnd |  |  |
mysqlnd |  |  | zlib |
odbc |  |  | unixodbc |
openssl | zlib |  | openssl zlib |
password-argon2 |  |  | libargon2 |
pdo_mysql | pdo mysqlnd |  |  |
pdo_odbc | pdo odbc |  | unixodbc |
pdo_pgsql | pdo pgsql |  | postgresql |
pdo_sqlite | pdo sqlite3 |  | sqlite |
pdo_sqlsrv | pdo sqlsrv |  |  |
pgsql |  |  | postgresql |
phar | zlib |  |  |
rdkafka |  |  | librdkafka |
readline |  |  | readline |
redis |  | session igbinary |  | zstd liblz4
simplexml |  |  | libxml2 |
snappy |  | apcu | snappy |
soap |  |  | libxml2 |
sodium |  |  | libsodium |
spx |  |  | zlib |
sqlite3 |  |  | sqlite |
sqlsrv |  |  | unixodbc |
ssh2 | openssl zlib |  | libssh2 |
swoole | openssl curl | swoole-hook-pgsql swoole-hook-mysql swoole-hook-sqlite | libcares brotli nghttp2 zlib |
swoole-hook-mysql | mysqlnd pdo pdo_mysql | mysqli |  |
swoole-hook-pgsql | pgsql pdo |  |  |
swoole-hook-sqlite | sqlite3 pdo |  |  |
swow |  | openssl curl |  | openssl curl
tidy |  |  | tidy |
uuid |  |  | libuuid |
uv | sockets |  | libuv |
xhprof | ctype |  |  |
xlswriter | zlib zip |  |  | openssl
xml |  |  | libxml2 |
xmlreader |  |  | libxml2 |
xmlwriter |  |  | libxml2 |
xsl | xml dom |  | libxslt |
xz |  |  | xz |
yac | igbinary |  | fastlz |
yaml |  |  | libyaml |
zip |  |  | libzip |
zlib |  |  | zlib |
zstd |  |  | zstd |

### Windows ​

Extension Name | Required Extensions | Suggested Extensions | Required Libraries | Suggested Libraries
--- | --- | --- | --- | ---
amqp | openssl |  | librabbitmq |
brotli |  |  | brotli |
bz2 |  |  | bzip2 |
curl | zlib openssl |  | curl |
dba |  |  |  | qdbm
dom | xml |  | libxml2 zlib |
ev | sockets |  |  |
ffi |  |  | libffi-win |
ftp |  |  |  | openssl
gd | zlib |  | zlib libpng | libavif libwebp libjpeg freetype
gmssl |  |  | gmssl |
iconv |  |  | libiconv-win |
igbinary |  | session apcu |  |
mbregex | mbstring |  | onig |
msgpack | session |  |  |
mysqli | mysqlnd |  |  |
mysqlnd |  |  | zlib |
openssl | zlib |  | openssl zlib |
parallel |  |  | pthreads4w |
pdo_mysql | pdo mysqlnd |  |  |
pdo_odbc | pdo odbc |  |  |
pdo_pgsql | pdo pgsql |  | postgresql-win |
pdo_sqlite | pdo sqlite3 |  | sqlite |
pdo_sqlsrv | pdo sqlsrv |  |  |
pgsql |  |  | postgresql-win |
phar | zlib |  |  |
redis |  | session igbinary |  |
simplexml | xml |  | libxml2 |
soap | xml |  | libxml2 |
sodium |  |  | libsodium |
sqlite3 |  |  | sqlite |
ssh2 | openssl zlib |  | libssh2 |
swow |  | openssl curl |  | openssl curl
xlswriter | zlib zip |  |  | openssl
xml | iconv |  | libxml2 |
xmlreader | xml dom |  | libxml2 |
xmlwriter | xml |  | libxml2 |
xz |  |  | xz |
yaml |  |  | libyaml |
zip | zlib bz2 |  | libzip zlib bzip2 xz |
zlib |  |  | zlib |

### FreeBSD ​

Extension Name | Required Extensions | Suggested Extensions | Required Libraries | Suggested Libraries
--- | --- | --- | --- | ---
brotli |  |  | brotli |
bz2 |  |  | bzip2 |
curl |  |  | curl |
dba |  |  |  | qdbm
ev | sockets |  |  |
ftp |  |  |  | openssl
mbregex | mbstring |  | onig |
mysqli | mysqlnd |  |  |
mysqlnd |  |  | zlib |
openssl | zlib |  | openssl zlib |
pdo_mysql | pdo mysqlnd |  |  |
phar | zlib |  |  |
xz |  |  | xz |
zlib |  |  | zlib |

## Library Dependency Table ​

### Linux ​

Library Name | Required Libraries | Suggested Libraries
--- | --- | ---
curl | openssl zlib | libssh2 brotli nghttp2 nghttp3 ngtcp2 zstd libcares
freetype | zlib | libpng bzip2 brotli
gettext | libiconv | ncurses libxml2
grpc | zlib openssl |
imagemagick | zlib libpng libjpeg libwebp freetype libtiff libheif bzip2 | zstd xz libzip libxml2
imap |  | openssl
ldap | openssl zlib gmp libsodium |
libacl | attr |
libevent | openssl |
libheif | libde265 libwebp libaom zlib brotli |
libpng | zlib |
librabbitmq | openssl |
librdkafka |  | zstd
libssh2 | openssl | zlib
libtiff | zlib libjpeg |
libxml2 | libiconv | xz icu zlib
libxslt | libxml2 |
libzip | zlib | bzip2 xz zstd openssl
nghttp2 | zlib openssl | libxml2 nghttp3 ngtcp2
nghttp3 | openssl |
ngtcp2 | openssl | nghttp3 brotli
openssl | zlib |
postgresql | libiconv libxml2 openssl zlib readline | icu libxslt ldap zstd
readline | ncurses |
snappy | zlib |
unixodbc | libiconv |
xz | libiconv |

### macOS ​

Library Name | Required Libraries | Suggested Libraries
--- | --- | ---
curl | openssl zlib | libssh2 brotli nghttp2 nghttp3 ngtcp2 zstd libcares
freetype | zlib | libpng bzip2 brotli
gettext | libiconv | ncurses libxml2
grpc | zlib openssl |
imagemagick | zlib libpng libjpeg libwebp freetype libtiff libheif bzip2 | zstd xz libzip libxml2
imap |  | openssl
ldap | openssl zlib gmp libsodium |
libevent | openssl |
libheif | libde265 libwebp libaom zlib brotli |
libpng | zlib |
librabbitmq | openssl |
librdkafka |  | zstd
libssh2 | openssl | zlib
libtiff | zlib libjpeg |
libxml2 | libiconv | xz icu zlib
libxslt | libxml2 |
libzip | zlib | bzip2 xz zstd openssl
nghttp2 | zlib openssl | libxml2 nghttp3 ngtcp2
nghttp3 | openssl |
ngtcp2 | openssl | nghttp3 brotli
openssl | zlib |
postgresql | libiconv libxml2 openssl zlib readline | icu libxslt ldap zstd
readline | ncurses |
snappy | zlib |
unixodbc | libiconv |
xz | libiconv |

### Windows ​

Library Name | Required Libraries | Suggested Libraries
--- | --- | ---
curl | zlib libssh2 nghttp2 | brotli zstd
freetype | zlib | libpng bzip2 brotli
libjpeg |  | zlib
libpng | zlib |
librabbitmq | openssl |
libssh2 | openssl | zlib
libxml2 | libiconv-win | zlib
libzip | zlib bzip2 xz | zstd openssl
nghttp2 | zlib openssl | libxml2 nghttp3 ngtcp2
nghttp3 | openssl |
ngtcp2 | openssl | nghttp3 brotli
openssl | zlib |

### FreeBSD ​

Library Name | Required Libraries | Suggested Libraries
--- | --- | ---
curl | openssl zlib | libssh2 brotli nghttp2 nghttp3 ngtcp2 zstd libcares
openssl | zlib |