Ubuntu/Debian
sudo apt install -y pkg-config build-essential autoconf bison re2c \
libxml2-dev libsqlite3-dev libonig-dev libssl-dev \
zlib1g-dev libcurl4-openssl-dev libedit-dev libreadline-dev
Arch
sudo pacman -Syu pkg-config base-devel autoconf bison re2c \
libxml2 oniguruma
Generate the config:
./buildconf
Config:
./configure --prefix=$HOME/.php --enable-debug \
--enable-mysqlnd \
--with-pdo-mysql \
--with-pdo-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--enable-bcmath \
--enable-fpm \
--with-fpm-user=www-data \
--with-fpm-group=www-data \
--enable-mbstring \
--enable-phpdbg \
--enable-shmop \
--enable-sockets \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
--with-curl \
--with-pear \
--with-openssl \
--enable-pcntl \
--with-readline \
--with-zlib \
--with-pdo-sqlite
Make and install:
make -j4
sudo make install