.htaccess 中的 php_flag [英] php_flag in .htaccess
问题描述
我运行一个 apache-server,我只需要一个 php_flag 就可以与虚拟主机中的全局配置不同.
I run an apache-server and I need just one php_flag to differ from the global configuration in a virtual host.
我在那个虚拟主机目录中没有 .htaccess 文件,所以我只是添加了它包含
I did not have a .htaccess file in that virtual hosts directory, so I just added it containing
php_flag flagname On
我的 httpd.conf 包含
My httpd.conf contains
<Directory "/path/to/host">
AllowOverride All
</Directory>
我使用标准的服务器 API,而不是 suPHP 或任何东西
and I use the standard server API, not suPHP or anything
无论如何,phpinfo 一直告诉我,我设置为 On 的标志仍然是 Off.标志是suhosin.simulation,应该可以在.htaccess中设置.
Anyway, phpinfo keeps telling me that the flag I set to On was still Off. The flag is suhosin.simulation, that one should be able to be set in .htaccess.
我错过了什么?
推荐答案
php_flag
只能设置 PHP_INI_ALL 和 PHP_INI_PERDIR 类型指令.您可能需要在 vhost 配置中的 <Directory xxxxxxxxxx>
</Directory>
范围内使用 php_admin_flag
.您需要重新启动 Apache 才能锁定它.
php_flag
can only set PHP_INI_ALL and PHP_INI_PERDIR type directives. You may need to use a php_admin_flag
within a <Directory xxxxxxxxxx>
</Directory>
scope in your vhost config. You will need to restart Apache to latch this.
这篇关于.htaccess 中的 php_flag的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!