Ubuntu 下安装yaf 框架

本文详细介绍了在Ubuntu环境下安装与配置PHP Yaf框架的过程,包括使用phpize工具进行安装,解决安装过程中遇到的错误,以及如何在php.ini中加载Yaf.so模块并重启PHP服务。同时提供了使用Yaf框架生成示例实例的方法。

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



转载于:https://www.cnblogs.com/Sven-w/p/4278082.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值