本文介绍了$ _SERVER ["SCRIPT_URL"]:何时可靠显示?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我的本地环境中(Apache 2.2.26上的PHP 5.4.24)存在$_SERVER["SCRIPT_URL"]
,但是我读到这个变量并不总是存在,即使我无法确切地找到它何时以及何时出现.不是.
In my local environment (PHP 5.4.24 on Apache 2.2.26) $_SERVER["SCRIPT_URL"]
is present, but I read around that this variable is not always present, even though I couldn't find exactly when it is and when it isn't.
我想知道可靠地显示此变量需要什么.
I'd like to know what is required for this variable to be reliably present.
推荐答案
仅在启用了mod_rewrite时可用:
It's only available when you have mod_rewrite enabled:
http://httpd.apache.org/docs/2.0/rewrite/rewrite_intro.html#EnvVar
这篇关于$ _SERVER ["SCRIPT_URL"]:何时可靠显示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!