VPS侦探论坛

 找回密码
 注册
查看: 5107|回复: 3

lnmp奇怪的问题,请教大概是什么问题?

[复制链接]
发表于 2015-2-26 11:49:40 | 显示全部楼层 |阅读模式

目前环境:安装了lnmp升级了php5.5.13


添加了 rewrite

     rewrite ^/(.*.php)(/)(.*)$ /$1?file=/$3 last;

                include other.conf;
                #error_page   404   /404.html;
                location ~ [^/]\.php(/|$)
                        {
                                # comment try_files $uri =404; to enable pathinfo
                                try_files $uri =404;
                                fastcgi_pass  unix:/tmp/php-cgi.sock;
                                fastcgi_index index.php;
                                include fastcgi.conf;
                                #include pathinfo.conf;
                        }

通过访问
http://xxx.com/test.php
正常获取到session

http://xxx.com/test.php/444.jpg
不能获取到session,但是已经执行了 test.php 了,为什么没获取到呢,请求header是一样的



#vi test.php
<?php
//之前设置过session
print_r($_SESSION)
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2015-2-26 19:55:06 | 显示全部楼层


http://xxx.com/test.php/444.jpg 像是属于pathinfo的类型
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2015-2-28 14:01:44 | 显示全部楼层

回复 2# 的帖子


如下配置还是一样。
http://xxx.com/test.php/444.jpg 就没有session
http://xxx.com/test.php/444.jppp 但这样就有,即最后缀 .jpg  png gif 都不行,其它都可以,是什么问题呢?


rewrite ^/(.*.php)(/)(.*)$ /$1?file=/$3 last;
location ~ [^/]\.php
                        {
                                # comment try_files $uri =404; to enable pathinfo
                                #try_files $uri =404;
                                fastcgi_pass  unix:/tmp/php-cgi.sock;
                                fastcgi_index index.php;
                                include fastcgi.conf;
                                include pathinfo.conf;
                        }
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2015-2-28 20:46:24 | 显示全部楼层

回复 3# 的帖子




rewrite和pathinfo是不能共存的
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-3-29 23:29 , Processed in 0.026237 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表