加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > PHP教程 > 正文

文件夹 – ‘覆盖’php.ini设置

发布时间:2020-12-13 13:42:48 所属栏目:PHP教程 来源:网络整理
导读:我有一个文件夹,对于该文件夹中的所有php文件(甚至更好,在该文件夹或其中的任何文件夹中)我想对php设置进行一些更改.我可以将php.ini文件放在该文件夹中,并提供我想要更改的设置吗? 如果是这样,为什么这对我不起作用?这是我自己的服务器. 谢谢! 编辑:我
我有一个文件夹,对于该文件夹中的所有php文件(甚至更好,在该文件夹或其中的任何文件夹中)我想对php设置进行一些更改.我可以将php.ini文件放在该文件夹中,并提供我想要更改的设置吗?

如果是这样,为什么这对我不起作用?这是我自己的服务器.

谢谢!

编辑:我希望能够使用本地php.ini文件,因为我已经能够使用几个webhosts.这有可能吗?

看起来你想要使用自 PHP 5.3起可用的 per-directory php.ini files.如果它是您自己的服务器,我想您很高兴能够跟上最新的稳定版本(目前为5.??3.2).返回ini文件,引用该手册页:

Since PHP 5.3.0,PHP includes support for .htaccess-style INI files on a per-directory basis. These files are processed only by the CGI/FastCGI SAPI. This functionality obsoletes the PECL htscanner extension. If you are using Apache,use .htaccess files for the same effect.

In addition to the main php.ini file,PHP scans for INI files in each directory,starting with the directory of the requested PHP file,and working its way up to the current document root (as set in $_SERVER[‘DOCUMENT_ROOT’]). Only INI settings with the modes PHP_INI_PERDIR and PHP_INI_USER will be recognized in .user.ini-style INI files.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读