nginx php構成

1096 ワード

nginx php環境の構築手順:
1.nginx構成:
server {       
       listen       4446;        
       server_name  localhost;          
       location/{         
       root    C:/htdocs/first/public/;    
       index  index.php index.htm ;
        }     
    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
     location ~\.php$ {    
       root           C:/htdocs/first/public/;       
       fastcgi_pass   127.0.0.1:9000;     
       fastcgi_index  index.php;     
      fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;       
      include        fastcgi_params;  
     }    
      # deny access to .htaccess files, if Apache's document root    
      # concurs with nginx's one      
      #      
     #location ~/\.ht {  
       #    deny  all;       
}    
}
2. php.iniファイルの構成
;cgi.fix_pathinfo=1  ;


 3.php-cgiを起動します.exe
php-cgiを使用します.exe -b 127.0.0.1:9000
以上がプロファイルの設定です.