zoukankan      html  css  js  c++  java
  • 让nginx支持PHP

    MAC为例

    1、安装nginx

    brew install nginx
    

    2、查找nginx配置文件在什么地方

    find /|grep nginx.conf
    

    3、修改配置文件nginx.conf

    cd /usr/local/etc/nginx
    vi nginx.conf
    
    location / {
                #root   html;
                root   /Users/zhoutingze/project/maturi/maturi/docroot/web;
                index  index.html index.htm index.php;
                rewrite (.*) /index.php;
            }
    
    location ~ .php$ {
                root           /Users/zhoutingze/project/maturi/maturi/docroot/web;
                fastcgi_pass   127.0.0.1:9000;
                fastcgi_index  index.php;
                #fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
                fastcgi_param  SCRIPT_FILENAME   $document_root$fastcgi_script_name;
                include        fastcgi_params;
            }
    

    4、cgi方式启动php

    cd /Applications/XAMPP/bin
    ./php-cgi -b 127.0.0.1:9000 -c /Applications/XAMPP/etc/php.ini
    

    5、启动nginx

    sudo nginx
    

    6、关闭nginx

    sudo nginx -s stop
    

      

  • 相关阅读:
    [ZJOI2011]营救皮卡丘
    TJOI2018Party
    HEOI2013SAO
    [BJOI2017]树的难题
    [HNOI2016]序列
    [SHOI2007]善意的投票
    CF802C Heidi and Library (hard)
    SPOJ DIVCNT2
    LOJ子序列
    BZOJ2882工艺
  • 原文地址:https://www.cnblogs.com/adtuu/p/4723499.html
Copyright © 2011-2022 走看看