Centos6.编译安装pcre时出现的问题及完美解决

本文档记录了在编译安装pcre-8.34过程中遇到的三个主要问题及解决方案:1) 提权运行configure脚本;2) 解决因卸载旧版pcre导致的依赖问题;3) 安装并执行autoreconf以修复aclocal-1.14缺失的问题。通过这些步骤,成功完成了pcre的编译安装。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

编译安装pcre-8.34时出现的问题

1、-bash: ./configure: 权限不够

解决:chmod增加x执行权限
在这里插入图片描述

[root@localhost pcre-8.34]# ./configure
-bash: ./configure: 权限不够
[root@localhost pcre-8.34]# chmod +x ./configure

2、rpm包安装pcre卸载后的nodeps参数问题,导致./configure出现问题,进而没有makefile文件,不能make

解决:grep依赖pcre, 得先安装一个老版本的pcre,才能编译新版的pcre

在这里插入图片描述

checking how to run the C preprocessor... grep: error while loading shared libraries: libpcre.so.0: cannot open shared object file: No such file or directory
gcc -E
grep: error while loading shared libraries: libpcre.so.0: cannot open shared object file: No such file or directory
checking for grep that handles long lines and -e... configure: error: no acceptable grep could be found in /usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/usr/xpg4/bin
[root@localhost pcre-8.34]# make
make: *** 没有指明目标并且找不到 makefile。 停止。

rpm包安装低版本的pcre:
在这里插入图片描述安装完成后./configure正常
在这里插入图片描述

3、make时出现问题

[root@localhost pcre-8.35]# make
CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/sh /lamp/pcre-8.35/missing aclocal-1.14 -I m4
/lamp/pcre-8.35/missing: line 81: aclocal-1.14: command not found
WARNING: 'aclocal-1.14' is missing on your system.
         You should only need it if you modified 'acinclude.m4' or
         'configure.ac' or m4 files included by 'configure.ac'.
         The 'aclocal' program is part of the GNU Automake package:
         <http://www.gnu.org/software/automake>
         It also requires GNU Autoconf, GNU m4 and Perl in order to run:
         <http://www.gnu.org/software/autoconf>
         <http://www.gnu.org/software/m4/>
         <http://www.perl.org/>
make: *** [aclocal.m4] 错误 127

在这里插入图片描述
解决:

[root@localhost pcre-8.35]# autoreconf -ivf
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force -I m4
autoreconf: configure.ac: tracing
autoreconf: running: libtoolize --copy --force
libtoolize: putting auxiliary files in `.'.
libtoolize: copying file `./ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
libtoolize: copying file `m4/libtool.m4'
libtoolize: copying file `m4/ltoptions.m4'
libtoolize: copying file `m4/ltsugar.m4'
libtoolize: copying file `m4/ltversion.m4'
libtoolize: copying file `m4/lt~obsolete.m4'
autoreconf: running: /usr/bin/autoconf --force
autoreconf: running: /usr/bin/autoheader --force
autoreconf: running: automake --add-missing --copy --force-missing
autoreconf: Leaving directory `.'

之后的安装就正常了

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值