关于yaf 框架的win安装
2015-10-10 16:28
519 查看
http://www.sunqinglin.cn/index.php/archives/329.html
PHP
首先YAF框架是一个非常不错优秀的框架,全称 Yet Another Framework,它是一个C语言写的一个框架,是一个以PHP扩展形式提供的PHP开发框架, 相比于一般的PHP框架, 它更快,更轻便. 它提供了Bootstrap, 路由, 分发, 视图, 插件, 是一个全功能的PHP框架。在win上是以文件形式dll后缀的扩展,那么怎么在php使用它,并且分层它的目录结构呢,我们可以结合yaf手册来学习。
首先要先到网上下载符合php版本的yaf扩展,就在写这篇博文的时候,刚刚得到消息,
linux可以直接yum来进行安装了。
接着我们的windows,下载好相应的版本,据我了解,yaf框架的win版php不能低于5.2.x,所以最好使用高版本的php,我这里是使用的php5以上的,那我下载php5的版本。所谓的NTS和ZTS在这里我认为是按照Thread Safety来说的,如果你的Thread Safety是enabled那就下载zts,反之的话 那就下载nts吧。点击去下载
下载到本地解压并放置在php中的ext里面 如:
在apache上配置rewrite规则,使它可以直接用域名来访问。但是要先在C:\Windows\System32\drivers\etc配置hosts,这里就不多说了。
apache的conf打开LoadModule rewrite_module modules/mod_rewrite.so
然后在最后的位置加上
<VirtualHost 127.0.0.1>
ServerAdmin test@gmail.com
directoryIndex index.html index.php index.htm index.shtml login.php
ServerName a.com
DocumentRoot D:\wamp\www\项目文件名\public
<Directory "D:\wamp\www\项目文件名\public">
Options -Indexes
AllowOverride All
Require all granted
</Directory>
#RewriteEngine On
#RewriteRule ^/.* /www/subdomain/index.html
</VirtualHost>
<VirtualHost 127.0.0.1>
ServerAdmin test@gmail.com
directoryIndex index.html index.php index.htm index.shtml login.php
ServerName xhprof.a.com
DocumentRoot D:\wamp\www\项目文件名\application\library\Debug\xhprof_html
<Directory "D:\wamp\www\项目文件名\application\library\Debug\xhprof_html">
Options -Indexes
AllowOverride All
Require all granted
</Directory>
#RewriteEngine On
#RewriteRule ^/.* /www/subdomain/index.html
</VirtualHost>
从上面的第二个配置中有一个xhprof.a.com ,xhprof 这个的话主要是一个扩展,它能具体到你项目的执行时间,sql的执行时间,有需要的朋友可以去下载安装一下。用phpinfo()查看一下yaf有没有存在,
目录结构的话 我把图粘进来,大家做个参考
其中conf的是配置文件
在里面新建文件application.ini 在里面加入
[product]
;支持直接写PHP中的已定义常量
application.directory=APP_PATH "/application/"
main_domain="http://www.a.com"
debug_domain="http://xhprof.a.com"
pic_domain="http://p.a.com"
static_domain="http://s.a.com"
application.modules=Index,Admin
;smarty
smarty.template_dir = APP_PATH "/application/views"
smarty.compile_dir = APP_PATH "/cache/smarty/compile"
smarty.cache_dir = APP_PATH "/cache/smarty/cache"
smarty.caching = FALSE
smarty.force_compile = FALSE
smarty.compile_check = TRUE
新建db.ini
在里面加入以下代码,根据自己的情况而修改
[db]
dsn='thinkmysqli://root:@localhost:3306/weibo_single#utf8'
那么public就是一些常用的公共文件了。
我这里整合和使用了thinkphp的一些数据库的操作。
也使用了smarty的模板
使用了thinkphp的debug。
都在目录
\application中的libray里
打开就能看到
这些有助于我们项目的快速开发。
到这里没有什么可介绍的了。
PHP
windows下yaf框架的安装和配置
2014年10月28日 ⁄ PHP, 编程开发 ⁄ 共 2234字 ⁄ 字号 小 中 大 ⁄ 暂无评论首先YAF框架是一个非常不错优秀的框架,全称 Yet Another Framework,它是一个C语言写的一个框架,是一个以PHP扩展形式提供的PHP开发框架, 相比于一般的PHP框架, 它更快,更轻便. 它提供了Bootstrap, 路由, 分发, 视图, 插件, 是一个全功能的PHP框架。在win上是以文件形式dll后缀的扩展,那么怎么在php使用它,并且分层它的目录结构呢,我们可以结合yaf手册来学习。
首先要先到网上下载符合php版本的yaf扩展,就在写这篇博文的时候,刚刚得到消息,
linux可以直接yum来进行安装了。
接着我们的windows,下载好相应的版本,据我了解,yaf框架的win版php不能低于5.2.x,所以最好使用高版本的php,我这里是使用的php5以上的,那我下载php5的版本。所谓的NTS和ZTS在这里我认为是按照Thread Safety来说的,如果你的Thread Safety是enabled那就下载zts,反之的话 那就下载nts吧。点击去下载
下载到本地解压并放置在php中的ext里面 如:
c:\php\ext,然后修改php.ini文件,在里面加入一行extension=php_yaf.dll
在apache上配置rewrite规则,使它可以直接用域名来访问。但是要先在C:\Windows\System32\drivers\etc配置hosts,这里就不多说了。
apache的conf打开LoadModule rewrite_module modules/mod_rewrite.so
然后在最后的位置加上
<VirtualHost 127.0.0.1>
ServerAdmin test@gmail.com
directoryIndex index.html index.php index.htm index.shtml login.php
ServerName a.com
DocumentRoot D:\wamp\www\项目文件名\public
<Directory "D:\wamp\www\项目文件名\public">
Options -Indexes
AllowOverride All
Require all granted
</Directory>
#RewriteEngine On
#RewriteRule ^/.* /www/subdomain/index.html
</VirtualHost>
<VirtualHost 127.0.0.1>
ServerAdmin test@gmail.com
directoryIndex index.html index.php index.htm index.shtml login.php
ServerName xhprof.a.com
DocumentRoot D:\wamp\www\项目文件名\application\library\Debug\xhprof_html
<Directory "D:\wamp\www\项目文件名\application\library\Debug\xhprof_html">
Options -Indexes
AllowOverride All
Require all granted
</Directory>
#RewriteEngine On
#RewriteRule ^/.* /www/subdomain/index.html
</VirtualHost>
从上面的第二个配置中有一个xhprof.a.com ,xhprof 这个的话主要是一个扩展,它能具体到你项目的执行时间,sql的执行时间,有需要的朋友可以去下载安装一下。用phpinfo()查看一下yaf有没有存在,
目录结构的话 我把图粘进来,大家做个参考
其中conf的是配置文件
在里面新建文件application.ini 在里面加入
[product]
;支持直接写PHP中的已定义常量
application.directory=APP_PATH "/application/"
main_domain="http://www.a.com"
debug_domain="http://xhprof.a.com"
pic_domain="http://p.a.com"
static_domain="http://s.a.com"
application.modules=Index,Admin
;smarty
smarty.template_dir = APP_PATH "/application/views"
smarty.compile_dir = APP_PATH "/cache/smarty/compile"
smarty.cache_dir = APP_PATH "/cache/smarty/cache"
smarty.caching = FALSE
smarty.force_compile = FALSE
smarty.compile_check = TRUE
新建db.ini
在里面加入以下代码,根据自己的情况而修改
[db]
dsn='thinkmysqli://root:@localhost:3306/weibo_single#utf8'
那么public就是一些常用的公共文件了。
我这里整合和使用了thinkphp的一些数据库的操作。
也使用了smarty的模板
使用了thinkphp的debug。
都在目录
\application中的libray里
打开就能看到
这些有助于我们项目的快速开发。
到这里没有什么可介绍的了。
相关文章推荐
- PHP写入数据到Txt和Excel文件
- php float转int的坑
- php 数组分组 二维数组中,将某个键值相同的合并到一个数组中
- 刷新PHP缓冲区为你的站点加速
- php手册之Callback 回调类型
- PHP和Mysql中转UTF8编码问题汇总
- PHP开发安全问题总结
- PHP环境搭建
- PHP水印
- php时间函数time(),date(),mktime()区别
- phpmyadmin的安装过程
- PHP漏洞全解
- Connection for controluser as defined in your configuration failed phpmyadmin xampp
- php文件操作函数
- echo使用!
- PHP生成图片随机验证码的方法
- thinkphp-mysql数据库的备份与还原
- intptr_t 其实不是指针类型
- PHP文件操作简介
- 分享五:php数组操作