资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

linux或windows下nginx开启phpinfo模式功能怎么配置

这篇文章主要介绍“linux或windows下nginx开启phpinfo模式功能怎么配置”,在日常操作中,相信很多人在linux或windows下nginx开启phpinfo模式功能怎么配置问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”linux或windows下nginx开启phpinfo模式功能怎么配置”的疑惑有所帮助!接下来,请跟着小编一起来学习吧!

创新互联专业为企业提供辰溪网站建设、辰溪做网站、辰溪网站设计、辰溪网站制作等企业网站建设、网页设计与制作、辰溪企业网站模板建站服务,10年辰溪做网站经验,不只是建网站,更提供有价值的思路和整体网络服务。

复制代码 代码如下:

location ~ \.php(.*)$ {
 fastcgi_pass   unix:/tmp/php-cgi.sock;
 fastcgi_index  index.php;
 fastcgi_split_path_info ^(.+\.php)(.*)$;
 fastcgi_param   script_filename $document_root$fastcgi_script_name;
 fastcgi_param   path_info       $fastcgi_path_info;
 fastcgi_param   path_translated $document_root$fastcgi_path_info;
 #include        fastcgi_params;
 include fcgi.conf;
}

一个完整的站点配置示例:

复制代码 代码如下:

log_format  v.lzw.me  '$remote_addr - $remote_user [$time_local] "$request" '
   '$status $body_bytes_sent "$http_referer" '
   '"$http_user_agent" $http_x_forwarded_for';
server {
 listen       80;
 server_name v.lzw.me;
 index index.html index.htm index.php default.html default.htm default.php;
 root  /www/v.lzw.me;

 # urlrewrite
 include v.lzw.me.conf;

 location ~ \.php(.*)$ {
  fastcgi_pass unix:/tmp/php-cgi.sock;
  fastcgi_index index.php;
  fastcgi_split_path_info ^(.+\.php)(.*)$;
  fastcgi_param   script_filename $document_root$fastcgi_script_name;
  fastcgi_param   path_info       $fastcgi_path_info;
  fastcgi_param   path_translated $document_root$fastcgi_path_info;
  #include        fastcgi_params;
  include fcgi.conf;
 }

 location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
  expires 30d;
 }

 location ~ .*\.(js|css)?$ {
  expires 12h;
 }

 access_log  /wwwlogs/v.lzw.me.log  v.lzw.me;
}

其他方法参考(适合windows下的nginx等):

复制代码 代码如下:

location ~ \.php
{
 fastcgi_pass 127.0.0.1:9000;
 fastcgi_index index.php;
 include fcgi.conf;
 set $real_script_name $fastcgi_script_name;
 if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {
  set $real_script_name $1;
  set $path_info $2;
 }
 fastcgi_param script_filename $document_root$real_script_name;
 fastcgi_param script_name $real_script_name;
 fastcgi_param path_info $path_info;
}

到此,关于“linux或windows下nginx开启phpinfo模式功能怎么配置”的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注创新互联网站,小编会继续努力为大家带来更多实用的文章!


名称栏目:linux或windows下nginx开启phpinfo模式功能怎么配置
当前链接:http://cdkjz.cn/article/peeehi.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

业务热线:400-028-6601 / 大客户专线   成都:13518219792   座机:028-86922220