Ubuntu 下安装yaf 框架

Ubuntu下安装yaf:php

https://github.com/laruence/php-yaf
html

进入下载的yaf
经过whereis phpize 查看安装安装在哪 好比在/usr/bin/
cd /usr/bin

phpize #若是提示没有安装 那么安装一下,sudo apt-get install php5-devgit

在目录下运行phpize就会 有configure了 ,
github

若是make错误 可能有这个问题:工具

/usr/include/php5/ext/pcre/php_pcre.h:29:18: fatal error: pcre.h: No such file or directoryspa

运行这个
code

sudo apt-get install libpcre3-dev

and then try and install Phalcon againhtm

For CentOS you will need to useget

sudo yum install pcre-devel

Credits: @xgretschit

For Mac you can use

brew install pcre

./configure --with-php-config=/usr/bin/php-config
       make
       make install
而后在php.ini中载入yaf.so, 重启PHP.
extension=yaf.so


使用yaf给的工具生成demo实例(我用http://www.laruence.com/manual/yaf.install.html 没有成功 和用工具生成的demo也不同,因此我就用工具生成了)
https://github.com/laruence/php-yaf/tree/master/tools/cg
进入你的下载目录 php-yaf / tools / cg

运行 php yaf_cg sample 会生成一个目录和文件进入查看readme.txt就是这里的readme2.txt


在升级PHP版本(v5.4.x)后从新安装Yaf,而后配置php.ini载入yaf.so后重启php遇到报错(红框根据本身环境看)