低版本PHP无法清理生成的configure文件的问题

今天在用PHP7.1的时候,执行phpize报错:

1
2
3
4
5
6
7
8
9
10
11
12
Cleaning..
Configuring for:
PHP Api Version: 20160303
Zend Module Api No: 20160303
Zend Extension Api No: 320160303
autoconf: warning: both `configure.ac' and `configure.in' are present.
autoconf: warning: proceeding with `configure.ac'.
/usr/bin/m4:configure.ac:6: cannot open `build/ax_gcc_func_attribute.m4': No such file or directory
/usr/bin/m4:configure.ac:8: cannot open `build/php_cxx_compile_stdcxx.m4': No such file or directory
/usr/bin/m4:configure.ac:9: cannot open `build/php.m4': No such file or directory
/usr/bin/m4:configure.ac:10: cannot open `build/pkg.m4': No such file or directory
autom4te: /usr/bin/m4 failed with exit status: 1

执行完phpize --clean之后,依然还是报这个错。发现是phpize --clean无法清理干净之前其他版本PHP生成的configure,所以,得手动删除:

1
rm configure*

然后重新执行phpize即可。