在 php-cli 中重新加载 php.ini
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5816930/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
php.ini reload in php-cli
提问by Anton
I have php script that must be runned from console (php-cli). But configuration of php.ini for php-cli was incorrect. I fix it, but when I run script a had error with php config, because php.ini uses an old.
我有必须从控制台(php-cli)运行的 php 脚本。但是 php-cli 的 php.ini 配置不正确。我修复了它,但是当我运行脚本时,php 配置出现错误,因为 php.ini 使用旧的。
How I can reload php.ini for console without restart server?
如何在不重启服务器的情况下为控制台重新加载 php.ini?
回答by Ignacio Vazquez-Abrams
The configuration is loaded fresh each time you invoke PHP from the CLI.
每次从 CLI 调用 PHP 时,都会重新加载配置。