安装好php环境之后
安装扩展包
$yum install php-devel
/usr/bin/ 就会出现phpize工具包
下载yaf-2.2.8.gz源文件,解压后,进入源文件
phpize
[root@localhost yaf-2.2.8]# phpize
Configuring for:
PHP Api Version: 20090626
Zend Module Api No: 20090626
Zend Extension Api No: 220090626
$./configure
$make
$make install
若出现报错
/usr/include/php/ext/pcre/php_pcre.h:37: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
/usr/include/php/ext/pcre/php_pcre.h:38: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
/usr/include/php/ext/pcre/php_pcre.h:44: error: expected specifier-qualifier-list before ‘pcre’
make: *** [yaf_router.lo] Error 1
安装pcre
$yum install pcre-devel
还报错的话,直接下载pcre源码包安装。
ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/
pcre-8.33.tar.gz
重启httpd
service httpd restart
查看php模块
$php -m
有yaf ,则安装成功!
接下来,使用代码生成工具生成一个domo
访问yaf在github上的地址https://github.com/laruence/php-yaf
下载zip包,解压,进入yaf目录/tools/cg
cd /home/lixianghui/Downloads/php-yaf-master/tools/cg
$yaf_cg Sample
会生成一个Sample目录,然后复制到/var/www/html/ 目录下,浏览器http://localhost/Sample/ 运行。
Hello World! I am Stranger