ini boxen / brew nginx开发配置w / fastcgi php-fpm

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ini boxen / brew nginx开发配置w / fastcgi php-fpm相关的知识,希望对你有一定的参考价值。

server {
  set $work_folder /work;
	listen 80;
    index index.php index.html index.htm;

	server_name ~^(.*)\.dev$;
	
	if (-d /work/$1/) {
            set $path $work_folder/$1;
    } 
	if (-d /work/$1/www/) {
       		set $path $work_folder/$1/www;
	}
	if (-d /work/$1/site/) {
       		set $path $work_folder/$1/site;
	}
	if (-d /work/$1/app/) {
       		set $path $work_folder/$1/app;
	}

    root $path;

	location ~ \.php$ {
                try_files $uri =404;
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                fastcgi_pass 127.0.0.1:9900;
                fastcgi_index index.php;
     	  		fastcgi_param  GATEWAY_INTERFACE  CGI/1.1;
				fastcgi_param  SERVER_SOFTWARE    nginx;
				fastcgi_param  QUERY_STRING       $query_string;
				fastcgi_param  REQUEST_METHOD     $request_method;
				fastcgi_param  CONTENT_TYPE       $content_type;
				fastcgi_param  CONTENT_LENGTH     $content_length;
				fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;
				fastcgi_param  SCRIPT_NAME        $fastcgi_script_name;
				fastcgi_param  REQUEST_URI        $request_uri;
				fastcgi_param  DOCUMENT_URI       $document_uri;
				fastcgi_param  DOCUMENT_ROOT      $document_root;
				fastcgi_param  SERVER_PROTOCOL    $server_protocol;
				fastcgi_param  REMOTE_ADDR        $remote_addr;
				fastcgi_param  REMOTE_PORT        $remote_port;
				fastcgi_param  SERVER_ADDR        $server_addr;
				fastcgi_param  SERVER_PORT        $server_port;
				fastcgi_param  SERVER_NAME        $server_name;
	 }
}


brew安装nginx及其使用

一,brew安装 前置条件:brew是ruby开发的,需要确认ruby是否已安装,缺省状况下是已经安装的。 homebrew是什么?它是Mac中的一款软件包管理工具,通过brew可以很方便的在Mac中安装软件或者是卸载软件。不了解的同学看以看官网(https://brew.sh/index_zh-c

以上是关于ini boxen / brew nginx开发配置w / fastcgi php-fpm的主要内容,如果未能解决你的问题,请参考以下文章

Mac配置PHP+Nginx+MySQL开发环境

Mac中配置eclipse的php开发环境

Warning:session_start()failed: 错误

mac下 home-brew安装及php,nginx环境安装及配置

ini 配置您的NGINX以捕获所有路由以加快本地开发#nginx #server

mac 使用brew安装nginx 各种命令