安装依赖
dnf install wget vim pcre pcre-devel openssl openssl-devel libicu-devel gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel ncurses ncurses-devel curl curl-devel krb5-devel openldap openldap-devel nss_ldap cmake boost-devel bison automake libevent libevent-devel gd gd-devel libtool* libxslt libxslt-devel readline readline-devel gmp gmp-devel libcurl libcurl-devel systemd-devel sqlite-devel libzip-devel make nginx
安装oniguruma
dnf --enablerepo=powertools install oniguruma-devel
下载PHP安装包
wget https://www.php.net/distributions/php-8.0.3.tar.gz
编译安装PHP
./configure --prefix=/usr/local/php8 --with-config-file-path=/usr/local/php8/etc --with-curl --with-freetype --enable-gd --with-jpeg --with-gettext --with-kerberos --with-libdir=lib64 --with-libxml --with-mysqli --with-openssl --with-pdo-mysql --with-pdo-sqlite --with-pear --enable-sockets --with-mhash --with-ldap-sasl --with-xsl --with-zlib --with-zip -with-bz2 --with-iconv --enable-fpm --enable-pdo --enable-bcmath --enable-mbregex --enable-mbstring --enable-opcache --enable-pcntl --enable-shmop --enable-soap --enable-sockets --enable-sysvsem --enable-xml --enable-sysvsem --enable-cli --enable-opcache --enable-intl --enable-calendar --enable-static --enable-mysqlnd
make && make install
测试
/usr/local/php8/bin/php --version
?初始化php.ini
cp php.ini-development /usr/local/php8/etc/php.ini
初始化FPM配置文件
cp /usr/local/php8/etc/php-fpm.d/www.conf.default /usr/local/php8/etc/php-fpm.d/www.conf
cp /usr/local/php8/etc/php-fpm.conf.default /usr/local/php8/etc/php-fpm.conf
mkdir /usr/local/php8/deamon
cp sapi/fpm/init.d.php-fpm /usr/local/php8/deamon/php-fpm
chmod 740 /usr/local/php8/deamon/php-fpm
?启动PHP-FPM
/usr/local/php8/deamon/php-fpm start
//----------------
|