Apache-2.2

Apache PHP 模組如何知道 php.ini 文件的位置?

  • March 28, 2015

我找到了這個頁面:http ://www.php.net/manual/en/configuration.file.php 。在我的作業系統上:Fedora 17、Apache 2.2、PHP 5.4 我在 httpd.conf 文件中搜尋了 PHPIniDir。此配置不存在。

那麼Apache如何知道php.ini在哪裡呢?(/etc/php.ini)

當未指定某些指令時,編譯時預設值作為故障安全存在。在這種情況下,如果沒有找到指令,PHP 模組“知道”到哪裡尋找 php.ini,因為它是以這種方式程式和編譯的。

實際上知道 php.ini 文件在哪裡的是 php。該資訊很可能被合併到 PHP Apache 模組中,該模組要麼由 PHP 版本生成,要麼在 apache 編譯期間使用 PHP 包。

引用自:https://serverfault.com/questions/474687