码迷,mamicode.com
首页 > Web开发 > 详细

在mac上搭建PHP开发环境

时间:2020-01-22 14:50:55      阅读:100      评论:0      收藏:0      [点我收藏+]

标签:war   fss   csharp   keepalive   dex   error_log   request   rect   cti   

首先安装homebrew:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

安装 nginx-1.10.2_1
  • <!-- lang: shell -->
  • brew search nginx
  • brew install nginx

 配置:

  • <!-- lang: shell -->
  • cd /usr/local/etc/nginx/
  • mkdir conf.d
  • vim nginx.conf
  • vim ./conf.d/default.conf
  • nginx.conf内容,
    <!-- lang: shell -->
    worker_processes 1; 
     
    error_log    /usr/local/var/log/nginx/error.log warn;
     
    pid    /usr/local/var/run/nginx.pid;
     
    events {
      worker_connections 256;
    }
     
    http {
      include    mime.types;
      default_type application/octet-stream;
     
      log_format main ‘$remote_addr - $remote_user [$time_local] "$request" ‘
               ‘$status $body_bytes_sent "$http_referer" ‘
               ‘"$http_user_agent" "$http_x_forwarded_for"‘;
     
      access_log   /usr/local/var/log/nginx/access.log main;
      port_in_redirect off;
      sendfile    on; 
      keepalive_timeout 65; 
     
      include /usr/local/etc/nginx/conf.d/*.conf;
    }
    default.conf文件内容,
    <!-- lang: shell -->
    server {
      listen    8080;
      server_name localhost;
     
      root /Users/user_name/nginx_sites/; # 该项要修改为你准备存放相关网页的路径
     
      location / { 
        index index.php;
        autoindex on; 
      }  
     
      #proxy the php scripts to php-fpm 
      location ~ \.php$ {
        include /usr/local/etc/nginx/fastcgi.conf;
        fastcgi_intercept_errors on; 
        fastcgi_pass  127.0.0.1:9000; 
      }  
     
    }
    

      

在mac上搭建PHP开发环境

标签:war   fss   csharp   keepalive   dex   error_log   request   rect   cti   

原文地址:https://www.cnblogs.com/ldphoebe/p/6047961.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!