安装PHP扩展都是使用 phpize工具完成的,以下以xdebug-2.0.4以例

tar zxvf xdebug-2.0.4.tgz
cd xdebug-2.0.4
/usr/local/php/bin/phpize
./configure --enable-xdebug --with-php-config=/usr/local/php/bin/php-config
make && make install && make clean
/usr/local/php/bin/phpize --clean

配置php.ini文件 ,完成安装。

今天在装的FreeBSD 7.2-RELEASE虚拟机配置PHP测试环境编译xdebug的时候碰到一个奇怪的问题,在执行完phpize后会提示一大堆的警告

configure.in:158: warning: AC_CACHE_VAL(lt_prog_compiler_static_works, ...): suspicious cache-id, must contain _cv_ to be cached
../../lib/autoconf/general.m4:1973: AC_CACHE_VAL is expanded from...
../../lib/autoconf/general.m4:1993: AC_CACHE_CHECK is expanded from...
aclocal.m4:3555: AC_LIBTOOL_LINKER_OPTION is expanded from...
aclocal.m4:5493: _LT_AC_LANG_C_CONFIG is expanded from...
aclocal.m4:5492: AC_LIBTOOL_LANG_C_CONFIG is expanded from...
aclocal.m4:2972: AC_LIBTOOL_SETUP is expanded from...
aclocal.m4:2952: _AC_PROG_LIBTOOL is expanded from...
aclocal.m4:2915: AC_PROG_LIBTOOL is expanded from...
configure.in:158: the top level
configure.in:158: warning: AC_CACHE_VAL(lt_prog_compiler_pic_works, ...): suspicious cache-id, must contain _cv_ to be cached
aclocal.m4:3510: AC_LIBTOOL_COMPILER_OPTION is expanded from...
aclocal.m4:7620: AC_LIBTOOL_PROG_COMPILER_PIC is expanded from...
configure.in:158: warning: AC_CACHE_VAL(lt_prog_compiler_pic_works_CXX, ...): suspicious cache-id, must contain _cv_ to be cached
aclocal.m4:5606: _LT_AC_LANG_CXX_CONFIG is expanded from...
aclocal.m4:5605: AC_LIBTOOL_LANG_CXX_CONFIG is expanded from...
aclocal.m4:4641: _LT_AC_TAGCONFIG is expanded from...
configure.in:158: warning: AC_CACHE_VAL(lt_prog_compiler_static_works, ...): suspicious cache-id, must contain _cv_ to be cached
../../lib/autoconf/general.m4:1973: AC_CACHE_VAL is expanded from...
../../lib/autoconf/general.m4:1993: AC_CACHE_CHECK is expanded from...
aclocal.m4:3555: AC_LIBTOOL_LINKER_OPTION is expanded from...
aclocal.m4:5493: _LT_AC_LANG_C_CONFIG is expanded from...
aclocal.m4:5492: AC_LIBTOOL_LANG_C_CONFIG is expanded from...
aclocal.m4:2972: AC_LIBTOOL_SETUP is expanded from...
aclocal.m4:2952: _AC_PROG_LIBTOOL is expanded from...
aclocal.m4:2915: AC_PROG_LIBTOOL is expanded from...
configure.in:158: the top level
configure.in:158: warning: AC_CACHE_VAL(lt_prog_compiler_pic_works, ...): suspicious cache-id, must contain _cv_ to be cached
aclocal.m4:3510: AC_LIBTOOL_COMPILER_OPTION is expanded from...
aclocal.m4:7620: AC_LIBTOOL_PROG_COMPILER_PIC is expanded from...
configure.in:158: warning: AC_CACHE_VAL(lt_prog_compiler_pic_works_CXX, ...): suspicious cache-id, must contain _cv_ to be cached
aclocal.m4:5606: _LT_AC_LANG_CXX_CONFIG is expanded from...
aclocal.m4:5605: AC_LIBTOOL_LANG_CXX_CONFIG is expanded from...
aclocal.m4:4641: _LT_AC_TAGCONFIG is expanded from...

在以前从来没有碰到过google一下找到答案,由于autoconf版本原因使用autoconf-2.62会有警示信息使用autoconf-2.61就不会了。

使用pkg_info命令查看

# pkg_info | grep autoconf
autoconf-2.13.000227_6 Automatically configure source code on many Un*x platforms
autoconf-2.62       Automatically configure source code on many Un*x platforms
autoconf-wrapper-20071109 Wrapper script for GNU autoconf

果然我的虚拟机里面就装了autoconf-2.62版本,解决问题最简单的办法就是卸载autoconf-2.62这个版本

cd /usr/ports/devel/autoconf262/
make deinstall

卸载后执行phpize就不会出现警示信息了,如果你还想用autoconf-2.62这个版本贴出不卸载的几种解决办法:
1、编辑phpize脚本内容
修改
phpize_check_autotools()
{
  test -z "$PHP_AUTOCONF" && PHP_AUTOCONF=autoconf
  test -z "$PHP_AUTOHEADER" && PHP_AUTOHEADER=autoheader
……

phpize_check_autotools()
{
  test -z "$PHP_AUTOCONF" && PHP_AUTOCONF=autoconf-2.61
  test -z "$PHP_AUTOHEADER" && PHP_AUTOHEADER=autoheader-2.61
……
将标注的地方改为指定版本即可,可以通过ll /usr/local/bin/autoconf*查看版本执行文件名。

2、设置环境变量法
env PHP_AUTOCONF=autoconf-2.61
env PHP_AUTOHEADER=autoheader-2.61

参考文章:
http://www.phpchina.com/html/76/676-8050.html
http://www.lupaworld.com/557/viewspace-1438.html