简体   繁体   English

尝试安装pecl扩展时,mac os x 10.7.3上的$ PHP_AUTOCONF错误

[英]$PHP_AUTOCONF errors on mac os x 10.7.3 when trying to install pecl extensions

I am trying to setup my machine with pecl_http and memcache and in both cases, I get similar errors. 我正在尝试使用pecl_http和memcache设置我的机器,在这两种情况下,我都会遇到类似的错误。 This is on MAC OS X 10.7.3 (lion) and I also have XCODE installed on it. 这是在MAC OS X 10.7.3(狮子)上,我也安装了XCODE。 I also installed Zend Server community edition before running these commands and have CFLAGS='-arch i386 -arch x86_64' environment variables set. 我还在运行这些命令之前安装了Zend Server社区版,并设置了CFLAGS =' - arch i386 -arch x86_64'环境变量。 So please help with what I need to do 所以请帮助我做我需要做的事情

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

更简单的解决方案

You need to install autoconfig. 您需要安装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. 在Mac OS X 10.8上的情况略有不同。 Highly voted solution from Bob Spryn doesn't work, because it doesn't create symlinks, so after installing autoconf you should make them: 来自Bob Spryn的高度投票解决方案不起作用,因为它不会创建符号链接,所以在安装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

I know that this question was for 10.7, but I hope my answer is useful for someone on 10.8. 我知道这个问题适用于10.7,但我希望我的答案对于10.8的人有用。 :) :)

Updated: Also works on 10.10 Yosemite. 更新:也适用于10.10 Yosemite。

or 要么

sudo port install autoconf

if you use macports 如果你使用macports

XCODE 4.3 doesn't put all the autoconf etc. tools in the Developer folder. XCODE 4.3没有将所有autoconf等工具放在Developer文件夹中。 It doesn't even create that folder in MACINTOSH HD. 它甚至没有在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. 我不得不降级到XCODE 4.2.1,它在Developer文件夹中安装了你需要的所有内容,现在我没有看到任何错误。

Also here is a useful reference . 这里也是一个有用的参考

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM