wqwqw121 发表于 2013-9-5 02:03:10

在Nginx服务器上运行EaglePHP框架pathinfo配置说明

EaglePHP框架默认采用pathinfo做资源定位,所以要求$_SERVER环境变量中必须要有PATHINFO。
一般在apache或者iis下都没有什么问题,但是在nginx下需要对配置文件做一些设置才可以。
把下面的代码保存为pathinfo.conf文件,存放在nginx的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;修改 nginx.conf 里的
location ~ \.php${} 这几行部分为

location ~ .*\.php {   #去掉 $ ,以便能匹配所有 *.php/* 形式的url

            root         /wnmp/www;

            fastcgi_pass   127.0.0.1:9000;

            #fastcgi_indexindex.php;

            fastcgi_paramSCRIPT_FILENAME $document_root$fastcgi_script_name;

            include      fastcgi_params;

            include      pathinfo.conf;

      }注意红色部分。

本文由www.ho87.com编辑发布
页: [1]
查看完整版本: 在Nginx服务器上运行EaglePHP框架pathinfo配置说明