Autoconf version 2.68 or higher is required

今天同事在安装php的redis扩展时,使用phpize报错,

 

 当前系统环境Centos7.7,

内网IP:192.168.80.61

PHP版本:7.3.18

redis扩展版本;4.2.0

 

[root@centos7 redis-4.2.0]# /usr/local/php/bin/phpize

Configuring for:

PHP Api Version:         20180731

Zend Module Api No:      20180731

Zend Extension Api No:   320180731

configure.ac:3: error: Autoconf version 2.68 or higher is required

configure.ac:3: the top level

autom4te: /usr/local/bin/m4 failed with exit status: 63

[root@centos7 redis-4.2.0]#

 

这种问题在Centos6.9上经常遇到,升级autoconf版本到2.69即可。

 

先卸载系统自带的autoconf,再安装一遍autoconf,

yum remove autoconf

yum安装autoconf,会自动安装m4依赖;手动下载安装autoconf,m4也可以;

yum install -y autoconf

 

检查2.69是否安装成功,

/usr/bin/autoconf -V

[root@centos7 ~]# /usr/bin/autoconf -V

autoconf (GNU Autoconf) 2.69

Copyright (C) 2012 Free Software Foundation, Inc.

License GPLv3+/Autoconf: GNU GPL version 3 or later

<http://gnu.org/licenses/gpl.html>, <http://gnu.org/licenses/exceptions.html>

This is free software: you are free to change and redistribute it.

There is NO WARRANTY, to the extent permitted by law.

 Written by David J. MacKenzie and Akim Demaille.

[root@centos7 ~]#

 

 再次使用/usr/local/php/bin/phpize,还是报同样的错误;

 降低PHP版本,重新解压redis源码包,依然报此错误;

在另外一台环境完全相同的服务器192.168.80.64上,安装同一版本的PHP和redis扩展,一路顺畅;

autoconf 2.69明明安装成功了,phpize就是装瞎看不见,挺郁闷....

 

晚上使用strace跟踪phpize,对比,

strace /usr/local/php/bin/phpize,

 

如下图:

左边是192.168.80.61,phpize报错,

右边是192.168.80.64,phpize正常,

 

看到这里就很明显了,左边的phpize使用的是/usr/local/bin/autoconf, 不是我们升级成功的2.69 /usr/bin/autoconf,

 

[root@centos7 ~]# find / -name  autoconf

/proc/sys/net/ipv6/conf/all/autoconf

/proc/sys/net/ipv6/conf/default/autoconf

/proc/sys/net/ipv6/conf/ens192/autoconf

/proc/sys/net/ipv6/conf/lo/autoconf

/proc/sys/net/ipv6/conf/virbr0/autoconf

/proc/sys/net/ipv6/conf/virbr0-nic/autoconf

/sys/module/ipv6/parameters/autoconf

/usr/bin/autoconf

/usr/share/doc/man-pages-overrides-7.7.3/autoconf

/usr/share/autoconf

/usr/share/autoconf/autoconf

/usr/local/bin/autoconf

/usr/local/share/autoconf

/usr/local/share/autoconf/autoconf

/customer/autoconf-2.69/bin/autoconf

/customer/autoconf-2.69/lib/autoconf

/customer/autoconf-2.69/tests/autoconf

[root@centos7 ~]#

[root@centos7 ~]# /usr/local/bin/autoconf -V

autoconf (GNU Autoconf) 2.62

Copyright (C) 2008 Free Software Foundation, Inc.

License GPLv2+: GNU GPL version 2 or later

<http://gnu.org/licenses/old-licenses/gpl-2.0.html>

This is free software: you are free to change and redistribute it.

There is NO WARRANTY, to the extent permitted by law.

 

Written by David J. MacKenzie and Akim Demaille.

[root@centos7 ~]#

[root@centos7 bin]# ll /usr/local/bin/

total 1688

-rwxr-xr-x. 1 root root  14652 May 27 09:59 autoconf

-rwxr-xr-x. 1 root root   8497 May 27 09:59 autoheader

-rwxr-xr-x. 1 root root  31511 May 27 09:59 autom4te

-rwxr-xr-x. 1 root root  20253 May 27 09:59 autoreconf

-rwxr-xr-x. 1 root root  17076 May 27 09:59 autoscan

-rwxr-xr-x. 1 root root  33677 May 27 09:59 autoupdate

-rwxr-xr-x. 1 root root   4058 May 27 09:59 ifnames

-rwxr-xr-x. 1 root root 812696 May 27 14:01 m4

-rwxr-xr-x. 1 root root 600616 May 25 10:14 tmux

-rwxr-xr-x. 1 root root  43584 May 27 11:16 zipcmp

-rwxr-xr-x. 1 root root  25144 May 27 11:16 zipmerge

-rwxr-xr-x. 1 root root 109504 May 27 11:16 ziptool

[root@centos7 bin]#

 

只删除/usr/local/bin/autoconf还不够,因为phpize还加载了/usr/local/bin/下的autoheader等,所以需要全部删除auto相关的安装

rm -rf auto* ifnames

 

posted @ 2020-05-28 22:05  engs  阅读(1077)  评论(0)    收藏  举报