Building PHP8

Here's my notes for building PHP 8 on a CentOS box.
They're not meant to be particularly comprehensible - I've just dumped them here for future reference!

mkdir /php8
cd /php8

wget -O php.zip https://github.com/php/php-src/archive/master.zip
unzip php.zip
cd php-src-master

apt-get install autoconf bison dpkg-dev file g++ gcc libc-dev make pkg-config re2c libxml2-dev libsqlite3-dev

yum groupinstall "Development Tools"
yum install autoconf
yum install re2c
yum install libxml2-devel
yum install sqlite-devel
yum install bzip2-devel
yum install libzip-devel
yum install openssl-devel

yum install libjpeg-devel
yum install freetype-devel

rpm -Uvh http://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/r/re2c-0.14.3-2.el7.x86_64.rpm

./buildconf

./configure --prefix=/usr/bin/php8 --enable-opcache --with-zlib --enable-json --enable-sockets --with-pear --enable-fpm --with-bz2 --with-zlib --enable-sockets --enable-sysvsem --enable-sysvshm --enable-pcntl --enable-mbregex --enable-exif --enable-bcmath --with-mhash --with-zip --with-pdo-mysql --with-mysqli --enable-inline-optimization --with-openssl --with-gd

make -j$(nproc)
make install

[root@localhost php-src-master]# make install

cp /etc/php.ini /usr/bin/php8/lib/
cp /etc/php-fpm.conf /usr/bin/php8/etc/
cp -R /etc/php-fpm.d/ /usr/bin/php8/etc/
vi /usr/bin/php8/etc/php-fpm.conf
include=/usr/bin/php8/etc/php-fpm.d/*.conf
;listen.acl_users

zend_extension=opcache.so
opcache.enable=1
opcache.enable_cli=1
opcache.jit_buffer_size=32M
opcache.jit=1235

cd /usr/bin/php8/bin
yum install -y libmemcached-devel --enablerepo=PowerTools
./pecl install memcached
vi /usr/bin/php8/lib/php.ini
extension=memcached.so

cd /usr/bin/php8/sbin
mkdir -p /run/php-fpm/
./php-fpm



Want to get in touch?