lnmp 下安装yaf

须有配置好的环境 详情见:centos6.5下yum安装lnmp(适合刚入职的新手的方法) http://www.cnblogs.com/qzjpkfj/p/4211126.html

具体安装步骤详情见:

转载自:Linux下安装php开发框架yaf    http://www.linuxde.net/2013/07/14805.html

1.下载并安装yaf扩展 http://pecl.php.net/package/yaf

#wget http://pecl.php.net/get/yaf-2.2.9.tgz
#tar zxvf yaf-2.2.9.tgz
#cd yaf-2.2.9

[root@bogon yaf-2.2.9]# whereis phpize
phpize: /usr/bin/phpize /usr/share/man/man1/phpize.1.gz   (有可能 whereis phpize 运行的是空的,我配置就是;是因为phpize没安;一条命令安装:yum install php-devel)
/usr/bin/phpize

[root@bogon yaf-2.2.9]# /usr/bin/phpize
Configuring for:
PHP Api Version: 20090626
Zend Module Api No: 20090626
Zend Extension Api No: 220090626
#whereis php-config
php-config: /usr/bin/php-config /usr/share/man/man1/php-config.1.gz

#./configure --with-php-config=/usr/bin/php-config  (如果提示错误:configure: error: in `/root/yaf-2.2.9':configure: error: no acceptable C compiler found in $PATHSee `config.log' for more details. 说明没安装gcc  一条命令安装 yum -y install gcc)
#make && make install
(make && make install 如果执行出错如下)

In file included from /root/yaf-2.1.2/yaf_router.c:28:

/usr/include/php/ext/pcre/php_pcre.h:29:18: error: pcre.h: No such file or directory

In file included from /root/yaf-2.1.2/yaf_router.c:28:

/usr/include/php/ext/pcre/php_pcre.h:45: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token

/usr/include/php/ext/pcre/php_pcre.h:46: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token

/usr/include/php/ext/pcre/php_pcre.h:52: error: expected specifier-qualifier-list before ‘pcre’

make: *** [yaf_router.lo] 错误 1

解决办法

# yum install pcre-devel  安装 pcre-devel即可解决了。

2.添加扩展配置到PHP.ini

在/etc/php.ini文件里添加一行

extension=yaf.so

重启webserver 即可。




posted @ 2015-01-13 21:54  敲着键盘看风景  阅读(531)  评论(0编辑  收藏  举报