Ubuntu 下安装yaf 框架

来源:互联网 发布:费县消失的夫妻知乎 编辑:程序博客网 时间:2024/05/22 05:13

Ubuntu下安装yaf:

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

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

phpize #如果提示没有安装 那么安装一下,sudo apt-get install php5-dev

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

如果make错误 可能有这个问题:

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

运行这个

sudo apt-get install libpcre3-dev

and then try and install Phalcon again

For CentOS you will need to use

sudo yum install pcre-devel

Credits: @xgretsch

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遇到报错(红框根据自己环境看)



0 0