当试图安装pecl扩展时,在mac os x 10.7.3上出现$ PHP_AUTOCONF错误

我试图用pecl_http和memcache设置我的机器,在这两种情况下,我得到类似的错误。 这是在MAC OS X 10.7.3(狮子),我也有XCODE安装在它上面。 在运行这些命令之前,我还安装了Zend Server社区版,并且设置了CFLAGS =' – arch i386 -arch x86_64'环境variables。 所以请帮助我需要做什么

bash-3.2# **sudo pecl install pecl_http-1.7.1** downloading pecl_http-1.7.1.tgz ... Starting to download pecl_http-1.7.1.tgz (174,098 bytes) .....................................done: 174,098 bytes 71 source files, building running: phpize Configuring for: PHP Api Version: 20090626 Zend Module Api No: 20090626 Zend Extension Api No: 220090626 Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF environment variable. Then, rerun this script. ERROR: `phpize' failed 
 brew install autoconf 

更简单的解决scheme

你需要安装autoconfig。 我通常喜欢从源代码安装库。 所以你可以做到以下几点:

 curl -OL http://ftpmirror.gnu.org/autoconf/autoconf-latest.tar.gz tar xzf autoconf-latest.tar.gz cd autoconf-* ./configure --prefix=/usr/local make sudo make install 

我刚刚和山狮一起去过

在Mac OS X 10.8的情况稍有不同。 来自Bob Spryn的高度投票解决scheme不起作用,因为它不会创build符号链接,所以在安装autoconf您应该:

 sudo ln -s /usr/local/Cellar/autoconf/2.69/bin/autoconf /usr/bin/autoconf sudo ln -s /usr/local/Cellar/autoconf/2.69/bin/autoheader /usr/bin/autoheader 

我知道这个问题是10.7,但我希望我的答案对10.8的人有用。 🙂

更新:也适用于10.10优胜美地。

要么

 sudo port install autoconf 

如果你使用macports

XCODE 4.3并没有把所有的autoconf等工具放在Developer文件夹中。 它甚至不在MACINTOSH HD中创build该文件夹。 我必须降级到XCODE 4.2.1,它将您需要的所有东西安装到Developer文件夹中,现在我看不到任何错误。

这里也是一个有用的参考 。

也许你需要链接autoconf与brew link autoconf