是否必须配置PHP才能通过PHP在每个目录的基础上扫描配置INI文件(在我的情况下为.htaccess文件)? [英] Is it mandatory to configure PHP in order to scan configuration INI files on a per-directory basis(i.e. .htaccess files in my case) by PHP?

查看:84
本文介绍了是否必须配置PHP才能通过PHP在每个目录的基础上扫描配置INI文件(在我的情况下为.htaccess文件)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在计算机上使用的是 Windows 10 Home Single Language 64位操作系统

I'm using Windows 10 Home Single Language 64-bit Operating System on my machine.

我已经安装了最新版本装有 PHP 7.2.7 的计算机上的 XAMPP服务器的信息

I've installed the latest copy of XAMPP server on my machine which ships with PHP 7.2.7

我从PHP手册中阅读了以下页面:

I read following pages from the PHP Manual :


  1. 扫描目录

  2. 。user.ini文件

  1. Scan directories
  2. .user.ini files

在阅读了这两页的文字后,我想到了一个疑问:

After reading the text from these two pages one doubt came to my mind :

要对每个配置扫描 INI文件 -基于目录的目录(在我的情况下为'。htaccess文件'),必须使用 --with-config在 CLI 上运行PHP -file-scan-dir 选项,然后按一下通过设置 PHP_INI_SCAN_DIR 环境变量在运行时出错吗?

To scan the configuration INI files on a per-directory basis(in my case '.htaccess files') by PHP is it mandatory to run PHP on CLI with the --with-config-file-scan-dir option and then by overriding at run time by setting the PHP_INI_SCAN_DIR environment variable?

还是进行这种配置 INI文件基于每个目录(在我的情况下为 .htaccess文件)自动通过PHP进行扫描?

Or do such configuration INI files on a per-directory basis(in my case '.htaccess files') get scan by PHP automatically?

如果是,则请向我解释一下如何在一种环境中进行设置(即 CLI )是否在完全不同的环境(即 SAPI )中起作用?

If yes, then please explain me how the setting made in one environment(i.e. CLI) has effect in an entirely different environment(i.e. SAPI)?

如果没有,请清除我的

推荐答案

PHP_INI_SCAN_DIR 环境变量不是与每个目录设置有关,它的功能完全不同。大多数Linux发行版都以将设置保存在不同文件中的方式来构建软件包,因此可以更轻松地安装和卸载单个软件包。因此,此变量只是将主配置文件拆分为目录中不确定数量的单独文件的一种技巧:

The PHP_INI_SCAN_DIR environment variable is not related to per-directory settings, it does something entirely different. Most Linux distributions build software packages in such a way that settings are kept in different files, so it's easier to install and uninstall individual packages. So this variable is just a trick to split the main configuration file into an undetermined number of separate files inside a directory:

/etc/php.d/




如何在一个环境中进行设置(即CLI)在完全不同的环境(即SAPI)中起作用?

how the setting made in one environment(i.e. CLI) has effect in an entirely different environment(i.e. SAPI)?

没有。 Apache模块将不会读取FastCGI设置,就像Apache将不会读取IIS设置一样。

It doesn't. The Apache module will not read the FastCGI settings just like Apache will not read IIS settings.

这篇关于是否必须配置PHP才能通过PHP在每个目录的基础上扫描配置INI文件(在我的情况下为.htaccess文件)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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