php 尝试安装 pecl 扩展时,mac os x 10.7.3 上的 $PHP_AUTOCONF 错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9322742/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
$PHP_AUTOCONF errors on mac os x 10.7.3 when trying to install pecl extensions
提问by krishna
I am trying to setup my machine with pecl_http and memcache and in both cases, I get similar errors. This is on MAC OS X 10.7.3 (lion) and I also have XCODE installed on it. I also installed Zend Server community edition before running these commands and have CFLAGS='-arch i386 -arch x86_64' environment variables set. So please help with what I need to do
我正在尝试使用 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
回答by Bob Spryn
brew install autoconf
Much easier solution
更简单的解决方案
回答by Ares
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.
我刚刚和山狮一起经历了这个。
回答by Anton Babenko
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:
在 Mac OS X 10.8 上情况略有不同。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。
回答by stoefln
or
或者
sudo port install autoconf
if you use macports
如果你使用 macports
回答by krishna
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.
XCODE 4.3 没有将所有的 autoconf 等工具放在 Developer 文件夹中。它甚至不会在 MACINTOSH HD 中创建该文件夹。我不得不降级到 XCODE 4.2.1,它在 Developer 文件夹中安装了你需要的一切,现在我看不到任何错误。
Also here is a useful reference.
这里也是一个有用的参考。
回答by Jichao
maybe you need link autoconf with brew link autoconf
.
也许您需要将 autoconf 与brew link autoconf
.