如何设置PHP的AUTO_ prepend_file每个目录指令? [英] How to set Php's auto_prepend_file directive per directory?

查看:408
本文介绍了如何设置PHP的AUTO_ prepend_file每个目录指令?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

背景:我有一些code,它会检查用户是否有处理PHP页面,我想设置为AUTO_ prepend_file前一个有效的会话。但是,我需要排除,用户尝试从需要一个有效的会话登录页面。我希望能够在一个每个目录的基础上设置AUTO_ prepend_file值。

Background: I've got some code that checks to see if a user has a valid session before processing the php page that I would like to set as the auto_prepend_file. However, I need to exclude the page where the user attempts to login from requiring a valid session. I would like to be able to set the auto_prepend_file value on an per directory basis.

环境:PHP 5.2.6m的Apache 2,运行PHP的一个CGI不是mod_php,并且,在Windows上(如果该事项)和一台机器上,我有完全的控制(而不是主机环境)上

Environment: PHP 5.2.6m Apache 2, running php as a cgi not as mod_php, on Windows (if that matters) and on a machine that I have complete control over (not a hosted environment)

使用htaccess文件超出B / C我没有使用mod_php的。我一直无法改变在php.ini设置AUTO_ prepend_file,服务器将引发一个内部错误。而ini_set()不工作二/三它已经加载的会话检查文件之前,我可以改变AUTO_ prepend_file值。

Using a htaccess file is out b/c I am not using mod_php. I have not been able to alter the in php.ini to set the auto_prepend_file, the server throws an internal error. And ini_set() does not work b/c it has already loaded the session checking file before I can change the value of auto_prepend_file.

我不明白,如果你不使用mod_php,并且/ htaccess的办法设置在每个目录的基础上AUTO_ prepend_file。我失去了一些东西?

I do not see a way to set auto_prepend_file on a per directory basis if you are not using mod_php/htaccess. Am I missing something?

推荐答案

使用.user.ini文件。

Use .user.ini files.

http://php.net/manual/en/configuration。 file.per-user.php的

这篇关于如何设置PHP的AUTO_ prepend_file每个目录指令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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