问题描述
有关基于Zend Framework的应用程序我使用的.htaccess
阿帕奇 SETENV
。我用这个测试上,分期和生产服务器,像这样:
For an application based on Zend Framework I use apaches SetEnv
in .htaccess
. I use this on test, staging and production servers like so:
SetEnv APPLICATION_ENVIRONMENT production
在临时服务器我无法读入PHP这个的环境变量。然而,当我做了一个的var_dump($ _ENV)
在PHP中我得到的价值,但关键是prepended与重定向_
成为
On the staging server I couldn't read this env var in PHP. However when I did a var_dump( $_ENV )
in php I got the value but the key was prepended with REDIRECT_
becoming
REDIRECT_APPLICATION_ENVIRONMENT
任何人都可以解释为什么发生这种情况,我怎么能prevent呢?
Can anybody explain why this is happening, and how I can prevent this?
推荐答案
我猜你有mod_rewrite的规则,在你的.htaccess以及对Zend的?我相信这可能是mod_rewrite的prepending,当它做了重定向,这样的值不会被任何新设置新的URL重写。
I'm guessing you have mod_rewrite rules in your .htaccess as well for Zend? I believe it may be mod_rewrite prepending that when it does a redirect so that the value won't be overridden by any new settings with the new URL.
这篇关于阿帕奇SETENV prepends REDIRECT_。是什么赋予了?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!