mac下安装yar

想试下yar,按着php的扩展教程装,奶奶的熊。结果行不通。好吧,开始折腾。

1.
wget http://pecl.php.net/get/yar-2.0.4.tgz
2.
tar xvzf yar-2.0.4.tgz
3.
cd yar-2.0.4/
4.
phpize
5.
./configure
然后就是这里一堆错:

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 for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
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-darwin18.0.0
checking host system type... x86_64-apple-darwin18.0.0
checking target system type... x86_64-apple-darwin18.0.0
configure: error: Cannot find php-config. Please use --with-php-config=PATH
liufeihongdeMacBook-Air:yar-2.0.4 liufeihong$ ./configure
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 for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
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-darwin18.0.0
checking host system type... x86_64-apple-darwin18.0.0
checking target system type... x86_64-apple-darwin18.0.0
checking for PHP prefix... /usr/local/Cellar/php/7.2.3_3
checking for PHP includes... -I/usr/local/Cellar/php/7.2.3_3/include/php -I/usr/local/Cellar/php/7.2.3_3/include/php/main -I/usr/local/Cellar/php/7.2.3_3/include/php/TSRM -I/usr/local/Cellar/php/7.2.3_3/include/php/Zend -I/usr/local/Cellar/php/7.2.3_3/include/php/ext -I/usr/local/Cellar/php/7.2.3_3/include/php/ext/date/lib
checking for PHP extension directory... /usr/local/Cellar/php/7.2.3_3/pecl/20170718
checking for PHP installed headers prefix... /usr/local/Cellar/php/7.2.3_3/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 yar support... yes, shared
checking for curl protocol support... yes, shared
checking for msgpack packager support... no
checking for cURL in default path... not found
configure: error: Please reinstall the libcurl distribution - easy.h should be in <curl-dir>/include/curl/

顶你个肺,我php -m扩展里明明有curl。这下就郁闷了。

怀疑可能是依赖的其他扩展没装
先装msgpack
pecl install msgpack
然后再装,还是报下面的错:
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 yar support... yes, shared
checking for curl protocol support... yes, shared
checking for msgpack packager support... yes
checking for cURL in default path... not found
configure: error: Please reinstall the libcurl distribution - easy.h should be in <curl-dir>/include/curl/
ERROR: `/private/tmp/pear/temp/yar/configure --with-php-config=/usr/local/opt/php/bin/php-config --enable-msgpack=yes' failed
逼得我看他的报错。
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
看这一句警告,行吧,先更新这个re2c:
brew install re2c

再来装:
pecl install yar
就是下面这一句了:
ERROR: `/private/tmp/pear/temp/yar/configure --with-php-config=/usr/local/opt/php/bin/php-config --enable-msgpack=yes' failed
尼玛那个壁,哥哥火爆脾气都上来了:
管他有没有,下个curl:
wget https://curl.haxx.se/download/curl-7.62.0.tar.gz
tar zxvf curl-7.62.0.tar.gz
./configure
make&&make install
然后去配置里加上扩展;
再运行:
pecl install yar

Build process completed successfully
Installing '/usr/local/Cellar/php/7.2.3_3/pecl/20170718/yar.so'
install ok: channel://pecl.php.net/yar-2.0.4
Extension yar enabled in php.ini

搞定。

猜你喜欢

转载自blog.csdn.net/moliyiran/article/details/84404121
今日推荐