简体   繁体   English

如果缺少 php.ini 会怎样?

[英]what happens if php.ini is missing?

What happens if php.ini is missing?如果缺少 php.ini 会怎样? Does PHP load with a default configuration? PHP 是否加载默认配置? In phpinfo(), it says the configuration file path is /etc, however it also says Loaded Configuration File (none).在 phpinfo() 中,它表示配置文件路径是 /etc,但它也表示已加载配置文件(无)。 I went into /etc, and noticed there is no php.ini, only php.ini.default.我进入 /etc,发现没有 php.ini,只有 php.ini.default。 PHP is working though, so I'm guessing it must load with default settings. PHP 正在工作,所以我猜它必须使用默认设置加载。 Can anybody confirm this for me?有人可以帮我确认一下吗?

PHP has what amounts to a php.ini compiled into it. PHP有相当于编译成php.ini的内容。 The php.ini file on the system is there merely to override those pre-compiled defaults. 系统上的php.ini文件仅用于覆盖那些预编译的默认值。 If there's no php.ini, the compile-time values are in charge. 如果没有php.ini,则编译时值是负责的。

它确实加载了默认设置,是的。

if php.ini is missing, u can choose one of this files and rename it to php.ini => this will give u the same results如果缺少 php.ini,您可以选择其中一个文件并将其重命名为 php.ini => 这会给您相同的结果

php.ini-development php.ini-production php.ini-开发 php.ini-生产

I wish this can help;)我希望这能有所帮助;)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM