-
Notifications
You must be signed in to change notification settings - Fork 365
Requirement
These requirements are for you to run phpbrew and build your PHP. To build your PHP, you need a lot of libraries installed on your system.
The instructions below help you to get things done. Please note that this document may not apply to the versions still under development, and you may need to install some libraries which are not listed here for certain extensions.
- Mac OS 10.5+
- Ubuntu
- Debian
- RHEL / CentOS / Rocky Linux / AlmaLinux
- Fedora
- openSUSE Tumbleweed/Leap
- Manjaro/Arch Linux
- PHP5.3+
- bz2
- curl
- gcc, binutils, autoconf, libxml, zlib, readline
xcode-select --install
brew install autoconf pkg-config bzip2 zlib openssl@1.1 oniguruma readline libzip libxml2
The following requirements will satisfy the +neutral
and +default
variant.
sudo apt-get install \
build-essential \
libbz2-dev \
libreadline-dev \
libsqlite3-dev \
libcurl4-gnutls-dev \
libzip-dev \
libssl-dev \
libxml2-dev \
libxslt-dev \
php8.1-cli \
php8.1-bz2 \
php8.1-xml \
pkg-config
sudo apt-get install \
build-essential \
libbz2-dev \
libreadline-dev \
libsqlite3-dev \
libcurl4-gnutls-dev \
libzip-dev \
libssl-dev \
libxml2-dev \
libxslt-dev \
libonig-dev \
php7.4-cli \
php7.4-bz2 \
php7.4-xml \
pkg-config
sudo apt-get install \
build-essential \
libbz2-dev \
libreadline-dev \
libsqlite3-dev \
libcurl4-gnutls-dev \
libzip-dev \
libssl-dev \
libxml2-dev \
libxslt-dev \
php7.2-cli \
php7.2-bz2 \
php7.2-xml \
pkg-config
Notes:
-
build-essential
provides the toolchain needed for building PHP and extensions from the source. -
libbz2-dev
is required for PHPBrew to be able to unpack PHP distribution archives. -
libsqlite3-dev
is required since the SQLite3 extension is enabled by default since PHP 5.3. -
libssl-dev
is required for PHPBrew to be able to download PHP distribution archives over HTTPS. -
libxml2-dev
andlibxslt-dev
are required for PHPBrew to be able to parse PEAR package definitions in XML. -
pkg-config
is required for the PHP build scripts to discover installed build dependencies.
sudo apt-get install \
build-essential \
libbz2-dev \
libreadline-dev \
libsqlite3-dev \
libssl-dev \
libxml2-dev \
libxslt1-dev \
php7.0-cli \
php7.0-bz2 \
php7.0-xml \
pkg-config
Please note that you need to disable the Suhosin patch to run PHPBrew.
sudo apt-get install \
build-essential \
libbz2-dev \
libreadline-dev \
libsqlite3-dev \
libssl-dev \
libxml2-dev \
libxslt1-dev \
php5-cli \
php5-bz2 \
php5-xml \
pkg-config
The following is the minimum requirements for PHPBrew to be able to build PHP versions with the +default
variant.
As an extra bonus, the command below doesn't install apache2, which is a dependency for PHP in Debian!
It has been tested with Debian 9, 10 and 11.
sudo apt install php7.0 php7.0-common php7.0-cli php7.0-fpm \
build-essential autoconf automake autotools-dev re2c \
libxml2 libxml2-dev libssl-dev openssl gettext libicu-dev \
libmcrypt-dev libmcrypt4 libmhash-dev libmhash2 libfreetype6 \
libfreetype6-dev libgd-dev libgd3 libpng-dev libpng16-16 libjpeg-dev \
libxpm4 libltdl7 libltdl-dev libreadline-dev libxslt1-dev \
php7.0-bz2 php7.0-xml libbz2-dev libcurl4-gnutls-dev libzip-dev
sudo apt install php7.3 php7.3-common php7.3-cli php7.3-fpm \
build-essential autoconf automake autotools-dev re2c \
libxml2 libxml2-dev libssl-dev openssl gettext libicu-dev \
libmcrypt-dev libmcrypt4 libmhash-dev libmhash2 libfreetype6 \
libfreetype6-dev libgd-dev libgd3 libpng-dev libpng16-16 libjpeg-dev \
libxpm4 libltdl7 libltdl-dev libreadline-dev libxslt1-dev \
php7.3-bz2 php7.3-xml libbz2-dev libcurl4-gnutls-dev libzip-dev
sudo apt install php7.4 php7.4-common php7.4-cli php7.4-fpm \
build-essential autoconf automake autotools-dev re2c \
libxml2 libxml2-dev libssl-dev openssl gettext libicu-dev \
libmcrypt-dev libmcrypt4 libmhash-dev libmhash2 libfreetype6 \
libfreetype6-dev libgd-dev libgd3 libpng-dev libpng16-16 libjpeg-dev \
libxpm4 libltdl7 libltdl-dev libreadline-dev libxslt1-dev \
php7.4-bz2 php7.4-xml libbz2-dev libcurl4-gnutls-dev libzip-dev
# these are equivalent to Debian's "build-essential"
sudo yum install make gcc gcc-c++ kernel-devel
sudo yum install php php-bz2 php-devel php-pear \
bzip2-devel yum-utils libmcrypt-devel libpqxx-devel libxslt-devel pcre-devel \
libcurl-devel libgsasl-devel openldap-devel \
libzip-devel readline-devel
sudo yum-builddep php
sudo yum install epel-release
sudo yum config-manager --set-enabled powertools
sudo yum update
sudo yum install make gcc gcc-c++ kernel-devel
sudo yum install php-json php-bz2 php-devel php-pear \
bzip2-devel yum-utils libmcrypt-devel libpq-devel libxslt-devel pcre-devel \
libcurl-devel libgsasl-devel openldap-devel \
libzip-devel readline-devel
sudo yum-builddep php
sudo yum install epel-release
sudo yum config-manager --set-enabled powertools
sudo yum config-manager --set-enabled crb
sudo yum update
sudo yum install make gcc gcc-c++ kernel-devel
sudo yum install php-json php-bz2 php-devel php-pear \
bzip2-devel yum-utils libmcrypt-devel libpq-devel libxslt-devel pcre-devel \
libcurl-devel libgsasl-devel openldap-devel \
libzip-devel readline-devel
sudo yum-builddep php
sudo yum install make gcc gcc-c++ kernel-devel
sudo yum install php-json php-bz2 php-devel php-pear \
bzip2-devel yum-utils libmcrypt-devel libpq-devel libxslt-devel pcre-devel \
libcurl-devel libgsasl-devel openldap-devel \
libzip-devel readline-devel
sudo yum-builddep php
To compile with +apxs2
sudo yum install httpd-devel
Please note that you need to disable suhosin patch to run phpbrew.
CentOS package requirements are the same as Fedora
# CentOS/RHEL 8.x:
sudo yum install epel-release
# CentOS/RHEL 7.x:
sudo yum install epel-release
sudo rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
# CentOS/RHEL 6.x:
sudo yum install epel-release
sudo rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm
# If you don't have php
sudo yum install --enablerepo=extras php php-bz2 php-xml libmhash
Before you start phpbrew installation:
sudo zypper in php7 php7-bz2 php7-phar php7-curl php7-openssl php7-json
For default and fpm variant installation:
sudo zypper in -t pattern devel_basis
sudo zypper in libxml2-devel libopenssl-devel libbz2-devel libxslt-devel libcurl-devel libzip-devel bzip2
To install
phpbrew install 7.0 +default +fpm -- --with-libdir=lib64
In order to be able to build PHP from an arbitrary source tree (e.g. from a git branch), an additional set of dependencies is needed.
brew install bison re2c
sudo apt-get install bison re2c
sudo yum install bison re2c
- Install php7.4+ ,
pkg-config
- Enable bz2 extension by un-commenting relevant entry
/etc/php/php.ini
file - Here is the command for PHPBrew with
+default
variant:
sudo pacman -S openssl-1.1 php base-devel libxslt pkg-config