由于我无法控制的原因,我无法在我的生产服务器上的 php.ini 中设置 display_errors=0 和 log_errors=1.我知道我可以设置 error_reporting(0); 以完全抑制所有错误消息,但这会影响日志错误和显示的错误.我希望有一个等价于在运行时设置 display_errors=0 和 log_errors=1 .这可能吗?谢谢.
For reasons outside my control I am unable to set display_errors=0 and log_errors=1 in php.ini on my production server. I know I can set error_reporting(0); to completely suppress all error messages, but this impacts both the log errors and the displayed errors. I was hoping there would be an equivalent to setting display_errors=0 and log_errors=1 at runtime. Is this possible? Thanks.
两者都是 PHP_INI_ALL,所以你可以只使用 ini_set 在运行时.
Both are PHP_INI_ALL, so you can just use ini_set at runtime.
ini_set('display_errors', 0);
ini_set('log_errors', 1);
参见http://php.net/manual/en/ini.list.php
这篇关于在没有 php.ini 的情况下设置 display_errors=0 和 log_errors=1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
MySQLi准备好的语句&foreach 循环MySQLi prepared statement amp; foreach loop(MySQLi准备好的语句amp;foreach 循环)
mysqli_insert_id() 是从整个服务器还是从同一用户获Is mysqli_insert_id() gets record from whole server or from same user?(mysqli_insert_id() 是从整个服务器还是从同一用户获取记录?)
PHP MySQLi 无法识别登录信息PHP MySQLi doesn#39;t recognize login info(PHP MySQLi 无法识别登录信息)
mysqli_select_db() 需要 2 个参数mysqli_select_db() expects exactly 2 parameters(mysqli_select_db() 需要 2 个参数)
Php mysql pdo 查询:用查询结果填充变量Php mysql pdo query: fill up variable with query result(Php mysql pdo 查询:用查询结果填充变量)
MySQLI 28000/1045 用户“root"@“localhost"的访问MySQLI 28000/1045 Access denied for user #39;root#39;@#39;localhost#39;(MySQLI 28000/1045 用户“root@“localhost的访问被拒绝)