php - 如何在PHP中设置和使用PHP_INI_SCAN_DIR环境变量?

标签 php configuration environment-variables php-ini scandir

我已在运行 Windows 10 的计算机上安装了 PHP 7.2.3。我已使用 XAMPP 包的最新副本安装了 PHP 和 Apache httpd 4.29

我在 PHP Manual 中看到以下文本

It is possible to configure PHP to scan for .ini files in a directory after reading php.ini. This can be done at compile time by setting the --with-config-file-scan-dir option. In PHP 5.2.0 and later, the scan directory can then be overridden at run time by setting the PHP_INI_SCAN_DIR environment variable.

It is possible to scan multiple directories by separating them with the platform-specific path separator (; on Windows, NetWare and RISC OS; : on all other platforms; the value PHP is using is available as the PATH_SEPARATOR constant). If a blank directory is given in PHP_INI_SCAN_DIR, PHP will also scan the directory given at compile time via --with-config-file-scan-dir .

我尝试了下面的代码,但无法设置环境变量 PHP_INI_SCAN_DIR

        <?php
            $_ENV['PHP_INI_SCAN_DIR'] = "Jumbo";
            print_r(getenv());
        ?>

请有人让我明白 PHP_INI_SCAN_DIR 到底是什么?以及如何使用/设置它?

最佳答案

关于php - 如何在PHP中设置和使用PHP_INI_SCAN_DIR环境变量?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49485364/

相关文章:

php - 从当前日期减去月份返回意外结果

php - 带有 CGridView 的 CJUIDatePicker 不起作用

java - 工作区设置与项目特定设置

configuration - 如何定义配置文件变量?

java - 如何在log4j.properties中使用系统环境变量?

perl - 如何确定是从命令行中调用脚本还是将其作为cgi脚本调用?

python - 如何使用 python 在 Mac OS X 中获取环境变量?

Java IllegalArgumentException 索引处查询中存在非法字符

c# - 如何检索程序集的限定类型名称?

php - 如何在不使用其父级的情况下设置 SimpleXmlElement 的文本值?