Zend的SETENV在.htaccess不工作 [英] Zend SetEnv in .htaccess not working

查看:184
本文介绍了Zend的SETENV在.htaccess不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的Ubuntu瀚士威安装的Zend。在我的.htaccess文件我有以下code:

I installed Zend on my ubuntu homeserver. In my .htaccess file i have the following code:

SetEnv APPLICATION_ENV development

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-s
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ index.php [NC,L]

当我回声APPLICATION_ENV在我的index.php公共文件夹,APPLICATION_ENV未设置。

When i echo APPLICATION_ENV in my index.php in the public folder, APPLICATION_ENV is not set.

我究竟做错了什么?

现代重写已在Apache启用。

Mod rewrite is enabled in apache.

推荐答案

为了使用SETENV内.htaccess文件,我相信你需要设置...

In order to use SetEnv within a .htaccess file, I believe you need to set...

AllowOverride FileInfo

...的相关虚拟主机目录块中。 (然后重新启动httpd服务按往常一样。)

...within the relevant virtualhost directory block. (And then restart the httpd service as per usual.)

此外,这取决于你如何运行PHP,它的可能的这些信息被剥离出来。 (例如:suEXEC的将有效地删除所有非HTTP *环境瓦尔)

Additionally, depending on how you're running PHP, it's possible that such information is being stripped out. (e.g.: suexec will effectively remove all non-HTTP* environment vars.)

这篇关于Zend的SETENV在.htaccess不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆