我正在尝试在我的mac中安装peel_http扩展程序,并认真对待它现在很头疼。我遵循了这个教程http://php-osx.liip.ch/但是当我给出命令/usr/local/php5/bin/pecl install pec_http
时,它给了我错误,这是我的终端堆栈。我真的想尽快开始。此外,如果他们有任何其他方式解决,这比这更好,请建议我。
这是我的堆栈。
sh-3.2# sudo /usr/local/php5/bin/pecl install pecl_http
No releases available for package "pecl.php.net/pecl_http"
install failed
sh-3.2# apachectl start
sh-3.2# export PATH=/usr/local/php5/bin:$PATH
sh-3.2# echo "$PATH"
/usr/local/php5/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/milind/Library/Android/sdk/platform-tools/
sh-3.2# /usr/local/php5-5.5.27-20150710-230047/bin/pecl install pecl_http
downloading pecl_http-2.5.3.tgz ...
Starting to download pecl_http-2.5.3.tgz (191,863 bytes)
.........................................done: 191,863 bytes
64 source files, building
running: phpize
Configuring for:
PHP Api Version: 20121113
Zend Module Api No: 20121212
Zend Extension Api No: 220121212
where to find zlib [/usr] :
where to find libcurl [/usr] :
where to find libevent [/usr] :
where to find libidn [/usr] :
building in /private/tmp/pear/temp/pear-build-rootFpNzEE/pecl_http-2.5.3
running: /private/tmp/pear/temp/pecl_http/configure --with-http-zlib-dir=/usr --with-http-libcurl-dir=/usr --with-http-libevent-dir=/usr --with-http-libidn-dir=/usr
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-apple-darwin15.0.0
checking host system type... x86_64-apple-darwin15.0.0
checking target system type... x86_64-apple-darwin15.0.0
checking for PHP prefix... /usr/local/php5
checking for PHP includes... -I/usr/local/php5/include/php -I/usr/local/php5/include/php/main -I/usr/local/php5/include/php/TSRM -I/usr/local/php5/include/php/Zend -I/usr/local/php5/include/php/ext -I/usr/local/php5/include/php/ext/date/lib
checking for PHP extension directory... /usr/local/php5/lib/php/extensions/no-debug-non-zts-20121212
checking for PHP installed headers prefix... /usr/local/php5/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
checking for gawk... no
checking for nawk... no
checking for awk... awk
checking if awk is broken... no
checking whether to enable extended HTTP support... yes, shared
checking for egrep... (cached) /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking how to run the C preprocessor... cc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for off_t... yes
checking for mbstate_t... yes
checking netdb.h usability... yes
checking netdb.h presence... yes
checking for netdb.h... yes
checking for unistd.h... (cached) yes
checking wchar.h usability... yes
checking wchar.h presence... yes
checking for wchar.h... yes
checking wctype.h usability... yes
checking wctype.h presence... yes
checking for wctype.h... yes
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking for gethostname... yes
checking for getdomainname... yes
checking for mbrtowc... yes
checking for mbtowc... yes
checking for iswalnum... yes
checking for inet_pton... yes
checking for idna.h... not found
checking for idn2.h... not found
checking unicode/uidna.h usability... no
checking unicode/uidna.h presence... no
checking for unicode/uidna.h... no
checking for uidna_IDNToASCII... no
checking for __uidna_IDNToASCII... no
checking for uidna_IDNToASCII in -licucore... yes
checking for zlib.h... not found
configure: error: could not find zlib.h
ERROR: `/private/tmp/pear/temp/pecl_http/configure --with-http-zlib-dir=/usr --with-http-libcurl-dir=/usr --with-http-libevent-dir=/usr --with-http-libidn-dir=/usr' failed
我真的不知道如何解决这个问题。各种帮助将不胜感激。非常感谢你。
答案 0 :(得分:0)
我在OSX中安装时遇到了类似的问题。我不确定您的OSX版本。
更新Xcode,然后安装“Xcode的命令行工具(OS X)”。
您可以尝试输入终端:
StackTrace
如果您有下载的麻烦,可以在Apple Dev下载,但是您需要一个免费的Apple Developer帐户才能登录并下载命令行工具。他们有一个新的Apple Developers下载站点,您可以在其中下载并安装Xcode的命令行工具(OS X Mavericks)。
这是链接:
https://developer.apple.com/xcode/download/
安装命令行工具后,
xcode-select --install
我重启了apache并且很高兴去了!