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

我试图用 pecl _ http 和 memcache 设置我的机器,在这两种情况下,我都会得到类似的错误。这是在 MAC OS X 10.7.3(lion)上,我也在上面安装了 XCODE。在运行这些命令之前,我还安装了 Zend Server 社区版,并设置了 CFLAGS =’-arch i386-arch x86 _ 64’环境变量。所以请帮帮我

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
100254 次浏览

XCODE 4.3 doesn't put all the autoconf etc. tools in the Developer folder. It doesn't even create that folder in MACINTOSH HD. I had to downgrade to XCODE 4.2.1 which installs everything you need in the Developer folder and now I see no errors.

Also here is a useful reference.

brew install autoconf

Much easier solution

or

sudo port install autoconf

if you use macports

You need to install autoconfig. I usually like to install libraries from source. So you can do the following:

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

I just went through this with Mountain Lion.

On Mac OS X 10.8 situation is slightly different. Highly voted solution from Bob Spryn doesn't work, because it doesn't create symlinks, so after installing autoconf you should make them:

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

I know that this question was for 10.7, but I hope my answer is useful for someone on 10.8. :)

Updated: Also works on 10.10 Yosemite.

maybe you need link autoconf with brew link autoconf.