一些PHP安装为什么会有$ _ SERVER ['SCRIPT_URI']和其他人没有? [英] Why do some PHP installations have $_SERVER['SCRIPT_URI'] and others not?
问题描述
我运行两个Apache 2的服务器。一个人PHP5.2和其他有PHP5.3。是否有一个原因,为什么5.3的机器上有 $ _ SERVER ['SCRIPT_URI']
?
I run two Apache 2 servers. One has PHP5.2 and the other has PHP5.3. Is there a reason why on the 5.3 machine has $_SERVER['SCRIPT_URI']
?
在哪里这个变量从何而来?这显然是一个从Apache的环境未来通过的东西,它不是在PHP手册中。但它是在结合 ['HTTPS']
, ['SERVER_NAME']
和方便的快捷键 ['REQUEST_URI']
。
Where does this variable come from? It is clearly something that is coming through from the Apache environment and it is not documented in the PHP manual. It is however a handy shortcut over a combination of ['HTTPS']
, ['SERVER_NAME']
and ['REQUEST_URI']
.
我曾尝试通过配置文件看,所以搜索和网页。
I have tried looking through configuration files, searching SO and the web.
推荐答案
根据张贴WebHostingTalk 它来自mod_rewrite的:
According to a post on WebHostingTalk it comes from mod_rewrite:
添加
RewriteEngine叙述在
要在httpd.conf文件要打开这个虚拟主机
对,然后重新启动Apache。
To the virtual host in your httpd.conf file that you want to turn this on for and then restart apache.
这篇关于一些PHP安装为什么会有$ _ SERVER ['SCRIPT_URI']和其他人没有?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!