一、安装php-8.1.9预编译报错
1、下载php软件包
[root@node1 ~]# wgethttps://www.php.net/distributions/php-8.1.9.tar.gz
2、安装依赖包
[root@node1~]# yum -y install php-mcrypt libmcrypt libmcrypt-devel autoconf freetype gd libmcrypt libpng libpng-devel libjpeg libxml2 libxml2-develzlib curl curl-devel re2c bzip2-devel libmcrypt-devel freetype-devellibjpeg-devel sqlite-devel libwebp expat-devel
3、解压php软件包
[root@node1 ~]# tar -zxvf php-8.1.9.tar.gz -C/usr/local/src/
4、预编译
[root@node1 ~]# cd /usr/local/src/php-8.1.9/
[root@node1php-8.1.9]# ./configure --prefix=/usr/local/php8.1.9 --enable-mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd--with-openssl --enable-fpm --enable-sockets --enable-gd --with-zlib--enable-sysvshm --enable-mbstring --with-freetype --with-expat --enable-xml--with-mhash --with-config-file-path=/etc--with-config-file-scan-dir=/usr/local/php8.1.9/etc/ --with-bz2 --with-jpeg
5、报如下错:
6、解决方法:
6.1安装oniguruma
[root@node1 ~]# wgethttps://rpms.remirepo.net/enterprise/7/remi/x86_64/oniguruma5php-6.9.7.1-1.el7.remi.x86_64.rpm--no-check-certificate
[root@node1 ~]# wgethttps://rpms.remirepo.net/enterprise/7/remi/x86_64/oniguruma5php-devel-6.9.7.1-1.el7.remi.x86_64.rpm--no-check-certificate
[root@node1 php-8.1.9]# rpm -ivhoniguruma5php-6.9.7.1-1.el7.remi.x86_64.rpm
[root@node1 php-8.1.9]# rpm -ivhoniguruma5php-devel-6.9.7.1-1.el7.remi.x86_64.rpm
[root@node1php-8.1.9]# yum install -y oniguruma5php-*
6.2再次进行预编译
[root@node1php-8.1.9]# ./configure --prefix=/usr/local/php8.1.9 --enable-mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd--with-openssl --enable-fpm --enable-sockets --enable-gd --with-zlib--enable-sysvshm --enable-mbstring --with-freetype --with-expat --enable-xml--with-mhash --with-config-file-path=/etc--with-config-file-scan-dir=/usr/local/php8.1.9/etc/ --with-bz2 --with-jpeg
可以看到报错已经解决了