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