Skip to content

Variant Dependencies

Sergei Morozov edited this page Mar 20, 2021 · 17 revisions

This page lists the dependencies for each variant, you can select the minimum installation for your system.

+curl

Homebrew:

brew install curl

Ubuntu 16.04 and newer:

apt-get install libcurl4-openssl-dev

Ubuntu 14.04:

apt-get install libcurl3-openssl-dev

+gd

Ubuntu 16.10 and newer:

apt-get install libjpeg8-dev libpng-dev libfreetype6-dev

Ubuntu 16.04 to 20.10:

apt-get install libjpeg8-dev libpng12-dev libfreetype6-dev

Ubuntu 21.10 and older:

apt-get install libjpeg-dev libpng-dev libfreetype-dev

+gmp

Ubuntu:

apt-get install libgmp-dev

In order to compile PHP 5 with GMP on Ubuntu 11.10 and newer, you may need to symlink some library files (source):

sudo ln -s /usr/include/x86_64-linux-gnu/gmp.h /usr/include/gmp.h

+iconv

Homebrew:

brew install libiconv

+imap (also requires +openssl dependencies)

Homebrew:

brew install imap-uw
brew install krb5

Ubuntu:

apt-get install libc-client2007e libc-client2007e-dev libkrb5-dev
ln -s /usr/lib/libc-client.a /usr/lib/x86_64-linux-gnu

+intl

Ubuntu:

apt-get install libicu-dev

+ldap

Homebrew:

brew install openldap

Ubuntu:

apt-get install libldap2-dev

In order to compile PHP 5 with LDAP on Ubuntu 11.10 and newer, you may need to symlink some library files (source):

ln -s /usr/lib/x86_64-linux-gnu/libldap.so /usr/lib/libldap.so
ln -s /usr/lib/x86_64-linux-gnu/liblber.so /usr/lib/liblber.so

+mbstring

As of PHP 7.4, the Oniguruma library is no longer bundled with PHP (see php/php-src#3795).

Ubuntu:

apt-get install libonig-dev

+mysql

As of PHP 5.3, PHP ships with bundled mysqlnd that makes libmysqlclient not required. If you still want to compile a MySQL-related extension with libmysqlclient, you'll need to install it.

Ubuntu:

apt-get install libmysqlclient-dev

+openssl

Note that:

  • PHP 5.6 and older require OpenSSL 1.0 and do not support OpenSSL 1.1.
  • As of Ubuntu 18.04, OpenSSL 1.1 is shipped.

Homebrew:

brew install openssl

Ubuntu 14.04:

apt-get install libssl-dev

+pgsql

Homebrew:

brew install libpq

Ubuntu 16.04:

apt-get install libpq5 libpq-dev

+sodium

Ubuntu:

apt-get install libsodium-dev

+sqlite

Ubuntu 16.04:

apt-get install libsqlite3-dev

+sqlsrv

Homebrew (documentation):

brew install msodbcsql17 mssql-tools

Ubuntu:

See the documentation.

+xml

Homebrew:

brew install libxml2

+zip

As of PHP 7.3, building against the bundled libzip is discouraged.

Ubuntu 16.10 and newer:

apt-get install libzip5 libzip-dev

Ubuntu 16.04:

apt-get install libzip4 libzip-dev

+zlib

Homebrew:

brew install zlib