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

以上就是配置文件的设置。

 

 

相关文章:

  • 2021-09-13
  • 2021-06-11
  • 2021-08-18
  • 2021-12-22
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-02-10
  • 2022-02-09
  • 2021-12-07
  • 2021-12-05
  • 2022-12-23
  • 2022-12-23
  • 2021-08-19
相关资源
相似解决方案