Home > Backend Development > PHP Tutorial > php CI框架路由失败问题

php CI框架路由失败问题

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-02 11:27:36
Original
1413 people have browsed it

框架php

接受到一个项目,用CI写的。放在本地wamp环境可以执行。但是放到线上linux服务器的时候
发现路由找不到相应的controller以及method。
调试了一会后发现根本原因是,变量_$SERVER['SCRIPT_NAME']在两个环境的值不一样。
比如我访问的域名为localhost/index.php/a/b。
本地环境的$_SERVER['SCRTIPT_NAME'] 值为/index.php,但是线上的值为/index.php/a/b
本地是apache,线上是nginx。我想问一下是不是所有的nginx服务器的值都是我这样,还是
是不是服务器方面做了特殊的配置,才导致$_SERVER['SCRTIPT_NAME'] 变化了。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template