English 中文(简体)
Zend SetEnv in .htaccess not working
原标题:Zend SetEnv in .htaccess not working

我安装了Zend,安装在我的布图家服务器上。 在我的查阅档案中,有以下法典:

SetEnv APPLICATION_ENV development

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

一、响应 页: 1 在公共场所,没有设置在册种姓。

什么是错了?

Mod rewrite能够在海滩上。

最佳回答

为了在查阅档案中使用SetaEnv,我认为你需要确定......

AllowOverride FileInfo

......在相关的虚拟目录中。 (然后按照惯例重新启用网上服务。)

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.)

问题回答

第一夫人 页: 1

如果阿帕奇有两部装满的模块:

apachectl -l or httpd -l

根据监督厅的分发,这一指挥可能有所不同。

如欲查阅文件,你需要工作,则允许所有人使用不同的配置文件(和“部分”),视你作为阿帕奇混编的协调员的方式而定。 你们的最佳选择是,如果它是一只便捷的存取文件或一个环境的话。 在主编档案中任何地方设立:

<>SetEnv TESTME foobar>

阿帕奇重新启用,并从PHP的文字中反映技术教育。 如果你去了,那就减少了。

Note 1: Restrict in your virtual host the usage of .htacess to the folder where you really need it or move the configurations to a virtual host.

说明2:如果安装了阿帕帕奇(<>strong>mod_dir,你很可能不需要所有重写规则。 检查

也可以使用:

RewriteRule .* - [E=ENV_NAME_HERE:ENV_VALUE_HERE]

我倾向于将SetaEnv列入http://www.un.org。 为当地服务器配置文件,以便我所有的当地ZF仪器都以发展方式运行,当我向老化服务器投放时,它有一条旗帜,将环境固定下来,那么生产服务器就没有这种环境,因而无法生产。

This way I can keep the same .htaccess file in source control and when I push it out to the different servers it behaves as expected.

中部的花园是赖特的。 根据网络论坛的回顾,Exec阻止你在你查阅档案中确定习俗环境变量。

If you are running your home server on a Mac or have suEXEC enabled, there are security measures in place to strip any non-http environment variables that are defined, therefore they won t appear in $_ENV[ APPLICATION_ENV ]. You CAN, however access these through a PHP function to get the same thing.

$var = apache_getenv( APPLICATION_ENV );

如果你想要,即使不建议,你甚至可以确定植物检疫中的环境变量。

$_ENV[ APPLICATION_ENV ] = apache_getenv( APPLICATION_ENV );

I have an almost identical config to what you have, and we just define a global:

define( APPLICATION_ENV , apache_getenv( APPLICATION_ENV ));

一旦你这样做,它就应当按照期望开展工作。





相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签