Http://www.sunqinglin.cn/index.php/archives/329.html
Installation and configuration of the YAF framework under PhpwindowsOctober 28, 2014 ⁄php, programming development ⁄ a total of 2234 characters ⁄ font size small big ⁄ no comments
First YAF framework is a very good excellent framework, full name yet another framework, it is a C language written framework, is a PHP extension in the form of a PHP development framework, compared to the general PHP framework, it is faster and lighter. It provides bootstrap, routing, distribution, views, plugins, and is a full-featured PHP framework. On win is the extension of the DLL suffix in file form, then how to use it in PHP, and layered its directory structure, we can combine the YAF manual to learn.
First of all to download the PHP version of the YAF extension, in writing this blog post, just got the news,
Linux can be installed directly with Yum.
Then our windows, download the corresponding version, as far as I understand, YAF framework of the win version of PHP can not be less than 5.2.x, so it is best to use the high version of PHP, I am here to use the php5 above, then I download php5 version. The so-called NTS and zts here I think is in accordance with the thread safety, if your thread safety is enabled then download Zts, conversely, then download nts it. Click to download
Download to local unzip and place in PHP ext inside such as: c:\php\ext
, and then modify the php.ini file, add a line inside Extension=php_yaf.dll
Configure the rewrite rule on Apache so that it can be accessed directly from the domain name. But first configure the hosts in C:\Windows\System32\drivers\etc, there is not much to say.
Apache Conf opens LoadModule rewrite_module modules/mod_rewrite.so
And then in the final position add
<virtualhost 127.0.0.1>
ServerAdmin [email protected]
directoryindex index.html index.php index.htm index.shtml login.php
servername a.com
documentroot D:\wamp\www\ project file name \ Public
<directory "D:\wamp\www\ project filename \public"
options-indexes
allowoverride all
Require all Granted
</directory>
#RewriteEngine on
#RewriteRule ^/.*/www/subdomain/index.html
</ Virtualhost>
<virtualhost 127.0.0.1>
ServerAdmin [email protected]
DirectoryIndex index.html index.php index.htm index.shtml login.php
ServerName xhprof.a.com
DocumentRoot D:\wamp\www\ Project file name \application\library\debug\xhprof_html
<directory "D:\wamp\www\ project file name \application\library\debug\ xhprof_html
options-indexes
allowoverride all
Require all granted
</directory>
# Rewriteengine on
#RewriteRule ^/.*/www/subdomain/index.html
</virtualhost>
From the second configuration above there is a xhprof.a.com, xhprof this word is mainly an extension, it can be specific to your project execution time, SQL execution time, the need for friends can go to download and install. Use Phpinfo () to see if YAF exists,
Directory structure of the words I put in the picture, we make a reference
Where Conf is the configuration file
Create a new file inside the Application.ini and add it inside.
[Product]
Support for directly writing defined constants in 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
New Db.ini
Add the following code to modify it according to your own situation
[db]
Dsn= ' thinkmysqli://root: @localhost: 3306/weibo_single#utf8 '
Then public is a common common file.
I am here to integrate and use some of the thinkphp database operations.
The Smarty template is also used.
thinkphp Debug is used.
All in the Catalog
In the Libray in \application
You can see it open.
These contribute to the rapid development of our projects.
There's nothing to introduce here.
About the win installation of the YAF framework