To maximize the server performance with highest speed, with fewest resources, i have decided to compile PHP 8 manually from minimal Linux/Unix-based OS (my Linux distro is rpm-based packages)
My system has successfully powered up by PHP 8.0.9 - with Opcache/JIT enabled & other several PHP extension module. Here is several experience that may save you several hours of research.
1. Before step (3) - Configure and build PHP - to ensure that no errors occurs, you can refer to my prerequisites library.
sudo dnf install \
gcc gcc-c++ make cmake autoconfig \
zlib zlib-devel pcre pcre-devel \
libxml2-devel libxslt-devel \
bzip2-devel curl-devel libzip-devel\
sqlite-devel \
systemd-devel \
openssl-devel \
libffi-devel \
libpng libpng-devel libwebp libwebp-devel libjpeg libjpeg-devel libXpm libXpm-devel \
freetype-devel \
gmp-devel \
libldb-devel \
libc-client libc-client-devel \
openldap openldap-devel \
oniguruma oniguruma-devel \
net-snmp-devel readline-devel unixODBC-devel \
uw-imap uw-imap-devel uw-imap-static uw-imap-utils \
libicu-devel \
enchant2 enchant2-devel \
gd gd-devel \
libsodium libsodium-devel \
libtidy libtidy-devel
You may not receive error when issuing ./configure, make && make install. Even when you manually build your PHP extension package later.
2. At step 5 - before modifying php.ini - you may double-check whether the current PHP is reading which php.ini file by this command
php -ini | grep php.ini
# My result. It is different from tutorial.
Configuration File (php.ini) Path => /usr/local/lib
Loaded Configuration File => /usr/local/lib/php.ini