问题描述
在centos7.6的环境上安装php7.4.30版本,在执行./configure命令时报错如下图:
执行./configure的命令如下:
./configure --prefix=/soft/php74 --with-config-file-path=/soft/php74/etc --with-libdir=/usr/lib64 --with-freetype=/usr/include/freetype2/freetype/ --with-jpeg=/usr/lib64 --disable-rpath --with-curl --enable-gd --with-gettext --with-mysqli --with-openssl --with-openssl-dir --with-iconv --with-zip --with-pdo-mysql --with-pdo-sqlite --with-xsl --with-zlib --with-bz2 --with-mhash --enable-fpm --enable-pdo --enable-session --enable-simplexml --enable-bcmath --enable-mbregex --enable-mbstring --enable-opcache --enable-pcntl --enable-shmop --enable-soap --enable-sockets --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-mysqlnd --enable-xml --enable-phar \
错误原因:mbstring的正则功能需要oniguruma的支持,系统中却没有oniguruma库。
解决方案
安装oniguruma或者不使用mbstring的正则功能,不再需要oniguruma库。
方案一
在’--enable-mbstring’参数后添加’--disable-mbregex’参数,意为不使用mbstring的正则功能,不再需要oniguruma库。
方案二
1.安装oniguruma库。
# 服务器能连上网直接通过命令下载oniguruma安装包
wget https://github.com/kkos/oniguruma/archive/v6.9.4.tar.gz -O oniguruma-6.9.4.tar.gz
# 不能连网访问地址:https://github.com/kkos/oniguruma 手动下载oniguruma安装包并上传到服务器
#安装过程
tar -zxvf oniguruma-6.9.4.tar.gz
cd oniguruma-6.9.4
./autogen.sh && ./configure --prefix=/usr --libdir=/lib64
make && make install
2.遇到的问题
执行:./autogen.sh && ./configure --prefix=/usr --libdir=/lib64 报错
原因是:是在运行 Autoconf 脚本(通常是 configure.ac
文件)的 autoreconf
命令时,但系统未能找到 aclocal
工具。
3.解决办法
如果服务器联网,直接执行命令: yum install autoconf automake libtool
如果服务器不联网,那可就只能下载rpm一个一个安装。
(1)先查看服务器上安装的autoconf automake libtool情况
目前只安装了autoconf,那么只需要安装剩下两个。
(2)下载对应操作系统版本的automake libtool的rpm包,并上传
(3)在服务器上安装automake libtool 包
注意:涉及到的rpm包,已在阿里云盘上传:
阿里云盘分享
提取码:p27l
命令:rpm -ivh *.rpm 安装当前目录下所有的rpm包。
报错:
原因:perl没安装一些组件:下载 对应perl的rpm包安装(perl-Thread-Queue-3.02-2.el7.noarch.rpm、perl-Test-Harness-3.28-3.el7.noarch.rpm)
安装per的两个包,安装好了之后,在执行安装automake libtool。如下图:安装成功。
4.再执行安装oniguruma库的命令
./autogen.sh && ./configure --prefix=/usr --libdir=/lib64
make && make install
到此 oniguruma库安装完成。