doujin4031 2018-07-19 16:40
浏览 79
已采纳

为了按PHP扫描配置INI文件(例如我的情况下的.htaccess文件)是否必须配置PHP?

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

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

I read following pages from the PHP Manual :

  1. Scan directories
  2. .user.ini files

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

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?

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

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

If no, then please clear my confusion with some suitable example.

  • 写回答

1条回答 默认 最新

  • drnrxv9383 2018-07-19 17:50
    关注

    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/
    

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

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

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 机器学习能否像多层线性模型一样处理嵌套数据
  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效