Home » PHP » (nineteen) configure the YAF framework under Mac

(nineteen) configure the YAF framework under Mac

machine: mac


Server: nginx

YAF version: 2.3.5





If you don't know how to join YAF under MAC nginx, there is also a description of GitHub on the following





The first step is to get the code

You can get code from two places under , you see:

(1), http://www.laruence.com/manual/index.html

(2), https://github.com/laruence/yaf





, and besides, my computer is Mac, so it's direct





$, WGet, https://github.com/laruence/yaf/archive/master.zip#, get the file

$, unzip, master.zip,
# unzip

$, CD, yaf-master/tools/cg,
# to CG to get the source code

# is the PHP command mode, which executes yaf_cg and creates a Sample file. Here's where your local PHP bin/php is and then executes the

$, PHP, yaf_cg, Sample

The location of the # file is generated in yaf-master/tools/cg/output. There is a Sample. The file name is created from what you entered, and you can specify the directory location, such as: /webroot/yaf





here I also get a php-yaf-doc equivalent to the inherited class library, this is the address on GitHub, https://github.com/elad-yosifon/php-yaf-doc did not elaborate on here.









The second step, configuring nginx



erver {

Charset UTF-8;

Client_max_body_size 128M;





Listen 80 #; here I use the 80 port, if you can switch to other occupied port





Server_name www.yaf.com; # domain own configuration, configuration after remember to modify hosts

Root /webroot/Sample; # code your own position, I was Sample

Index index.php;





Access_log /webroot/logs/yaf_access.log;





Location / {

Try_files, $uri, $uri/, /index.php, $args,

}





Location ~ (js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar) ${

Try_files $uri =404;

}

#error_page 404, /404.html;





Location ~.Php${

Include fastcgi.conf;

Fastcgi_pass 127.0.0.1:9000;

#fastcgi_pass unix:/var/run/php5-fpm.sock;

Try_files $uri =404;

}





Location ~ (ht|svn|git) {
.
Deny all;

}

}





Don't worry # configuration after the completion of access to the page, we also need to restart nginx

Sudo own file path /nginx/bin/nginx -t

# if there is no problem you can configure OK to restart

Sudo own file path /nginx/bin/nginx, -s, reload

# look at whether to start
service
PS -ef grep nginx
|




The third step, modify the php.ini

our initial configuration of YAF is an extension of the YAF extension

extension=yaf.so

yaf.environ= "product" # retrieval environment, if you start adding without adding









, if modified, remember */php/sbin/php-fpm restart restart php













The fourth step is to access the domain name

, the www.yaf.com I configured above, and the result returned by the page is.





Hello, World, I, am, Stranger













If there is no display, check the PHP log.





Please indicate the source: http://blog.csdn.net/arthuralston2015/article/details/50881799












































Latest