如果缺少php.ini会怎样? [英] what happens if php.ini is missing?
问题描述
如果缺少php.ini会怎样? PHP是否以默认配置加载?在phpinfo()中,它说配置文件的路径是/etc,但是它也说了Loaded Configuration File(无).我进入/etc,发现没有php.ini,只有php.ini.default.虽然PHP可以正常工作,所以我猜测它必须使用默认设置加载.有人可以帮我确认一下吗?
What happens if php.ini is missing? Does PHP load with a default configuration? In phpinfo(), it says the configuration file path is /etc, however it also says Loaded Configuration File (none). I went into /etc, and noticed there is no php.ini, only php.ini.default. PHP is working though, so I'm guessing it must load with default settings. Can anybody confirm this for me?
推荐答案
PHP相当于将php.ini编译到其中.系统上的php.ini文件仅用于覆盖这些预编译的默认值.如果没有php.ini,则由编译时值负责.
PHP has what amounts to a php.ini compiled into it. The php.ini file on the system is there merely to override those pre-compiled defaults. If there's no php.ini, the compile-time values are in charge.
这篇关于如果缺少php.ini会怎样?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!