mac 使用homebrew安装lnmp

1. brew install nginx
2. brew install php70
 
3. 配置Nginx
 
①    定义根目录
        root   /usr/local/sk    将这一部分放到server块里面,去掉其他location块里面的root
 
②    nginx + php 整合,只需将 location ~ \.php 这部分注释去掉
 
开启pathinfo模式 只需修改下面两处
 
location ~ \.php(.*)$ {
    fastcgi_pass 127.0.0.1:9000;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_param PATH_INFO $1;
    include fastcgi_params;
}
 
关于path_info的配置,网上找了好久,一直没解决,后来看了这哥们的博客终于搞定了,附个连接:http://blog.csdn.net/pangchengyong0724/article/details/51433440
 
 
posted @ 2017-06-22 14:58  大师兄sk  阅读(234)  评论(0编辑  收藏  举报