linux环境下安装yaf

一、ubuntu环境

1、首先到http://pecl.php.net/get/yaf下载最新版本的yaf,我的是yaf-2.2.9.tgz。

2、解压 tar -zxvf yaf-2.2.9.tgz,  进入到解压后的文件夹cd yaf-2.2.9.tgz
3、执行/usr/bin/phpize (phpize的目录可能不同哦)  ,然后执行./configure --with-php-config=/usr/bin/php-config  (注意等号两边不能有空格)
4、执行make ,此时有可能出现make: *** [yaf_router.lo] 错误 1的错误提示,解决方法为 sudo apt-get install libpcre3 libpcre3-dev openssl libssl-dev
5、最后执行 sudo make install  (要用管理员的权限)
6、最后会提示你yaf.so扩展模块在哪,说明安装成功了!

二、linux环境

php5.5

nginx1.4.6

下面开始安装

下载最新的yaf包

http://pecl.php.net/package/yaf 

我下载的最新版本为2.3.3

解压 

   $PHP_BIN/phpize
      ./configure --with-php-config=$PHP_BIN/php-config
      make
      make install

我执行时报错误。

用whereis phpize 查看查看phpize,发现phpize为空,说明没有安装

执行这个命令

sudo apt-get install php-dev

执行完后,用whereis phpize

komiles@Aspire-v5 ~ $ whereis phpize
phpize: /usr/bin/phpize /usr/bin/X11/phpize /usr/share/man/man1/phpize.1.gz

看到这个说明你已经安装了phpize

然后执行这个(必须用root用户执行,否则会报错误)

 /usr/bin/phpize ./configure --with-php-config=/usr/bin/php-config

下面这个错误

Cannot find config.m4. 
Make sure that you run '/usr/bin/phpize' in the top level source directory of the module

执行make命令时报这个错误

make: *** No targets specified and no makefile found.  Stop.

需要安装

 
 
sudo apt-get install libncurses5-dev
 

这样执行

./configure make
原文地址:https://www.cnblogs.com/cocoqi/p/7365905.html