**一.安装PHP8依赖包** ~~~ yum -y install autoconf freetype gd libpng libpng-devel libjpeg libxml2 libxml2-devel zlib curl curl-devel net-snmp-devel libjpeg-devel php-ldap openldap-devel openldap-clients freetype-devel gmp-devel libzip libzip-devel sqlite-devel ~~~ **二.编译PHP8依赖包oniguruma** 1.解压 ~~~ tar -zxvf oniguruma-6.9.4.tar.gz ~~~ 2.切换目录 ~~~ cd oniguruma-6.9.4/ ~~~ 3.生成configure ~~~ ./autogen.sh ~~~ 4.生成编译配置文件 ~~~ ./configure --prefix=/usr ~~~ 5.编译并安装 ~~~ make && make install ~~~ 2.编译PHP8主包 1.解压 ~~~ tar xzf php-8.0.0.tar.gz ~~~ 2.切换目录 ~~~ cd php-8.0.0/ ~~~ 3.生成编译配置文件 ~~~ ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --enable-fpm --with-fpm-user=nginx --with-fpm-group=nginx --enable-mysqlnd --with-mysqli --with-pdo-mysql --enable-opcache --with-pcre-jit --enable-gd --with-jpeg --with-freetype --with-gettext --with-curl --with-openssl --enable-sockets --enable-mbstring --enable-xml --with-zip --with-zlib --with-snmp --with-mhash --enable-ftp --enable-bcmath --enable-soap --enable-shmop --enable-sysvsem --enable-pcntl --with-gmp ~~~ 4.编译并安装 ~~~ make && make install ~~~ ###