Skip to content

Latest commit

 

History

History
81 lines (70 loc) · 1.65 KB

build-php.md

File metadata and controls

81 lines (70 loc) · 1.65 KB

build php from source

credits

https://php.watch/articles/compile-php-ubuntu

instructions

add packages

apk add \
autoconf \
bison \
build-base \
bzip2-dev \
curl-dev \
gettext-dev \
git \
icu-dev \
imap-dev \
libpng-dev \
libsodium-dev \
libxml2-dev \
libzip-dev \
oniguruma-dev \
openldap-dev \
pkgconfig \
re2c \
sqlite-dev

configure php repo

git clone https://github.com/php/php-src.git --depth=1000
cd php-src
git checkout php-8.3.0RC4

build

`=shared` build as shared module = not included inside the php binary

./buildconf
./configure \
--enable-fpm \
--enable-bcmath=shared \
--with-bz2=shared \
--enable-calendar=shared \
--with-curl=shared \
--enable-exif=shared \
--enable-ftp=shared \
--enable-gd=shared \
--with-gettext=shared \
--with-imap=shared \
--with-imap-ssl=shared \
--enable-intl=shared \
--with-ldap=shared \
--enable-mbstring=shared \
--with-mysqli=shared \
--enable-pcntl=shared \
--with-pdo-mysql=shared \
--with-sodium=shared \
--with-zip=shared \
--enable-ctype=shared \
--enable-dom=shared \
--enable-fileinfo=shared \
--enable-pdo=shared \
--with-pdo-sqlite=shared \
--with-sqlite3=shared \
--enable-phar=shared \
--enable-xml=shared \
--enable-xmlreader=shared \
--enable-xmlwriter=shared \
--enable-simplexml=shared \
--enable-session=shared \
--enable-posix=shared \
--with-openssl=shared \
--enable-opcache=shared \
--enable-tokenizer=shared

make -j $(nproc)
cd sapi
./php -v