gpt4 book ai didi

php - 获取 PHP INI 文件

转载 作者:行者123 更新时间:2023-12-02 22:58:41 25 4
gpt4 key购买 nike

有没有办法使用类似的东西

ini_get_all()

并将 .ini 文件实际的样子输出到屏幕。我的意思是你可以复制并粘贴它。这是因为我实际上无法访问主机 .ini,但可以创建自己的主机。但是当我自己制作时,它会丢失所有当前设置,因此我需要知道它当前是如何设置的。

最佳答案

试试这个:

echo file_get_contents(php_ini_loaded_file());

您还可以检查您的 php 是否正在加载主 php.ini 之外的任何其他 .ini 文件。

//This will return you a comma separated list of the additional ini files loaded
$additional_ini_files = php_ini_scanned_files();

// The explode and the str_replace is for removing the new line char from the strings
foreach(explode(",\n",$additional_ini_files) as $ini_file_path){

echo file_get_contents(str_replace("\n","",$ini_file_path));

}

关于php - 获取 PHP INI 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16970644/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com