PHP 5禁用严格标准错误 [英] PHP 5 disable strict standards error

查看:96
本文介绍了PHP 5禁用严格标准错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在顶部设置PHP脚本以禁用严格标准的错误报告.

I need to setup my PHP script at the top to disable error reporting for strict standards.

有人可以帮忙吗?

推荐答案

您要禁用错误报告,还是只是阻止用户查看错误报告?通常甚至在生产站点上记录错误也是一个好主意.

Do you want to disable error reporting, or just prevent the user from seeing it? It’s usually a good idea to log errors, even on a production site.

# in your PHP code:
ini_set('display_errors', '0');     # don't show any errors...
error_reporting(E_ALL | E_STRICT);  # ...but do log them

它们将被记录到您的标准系统日志中,或使用error_log指令指定您希望错误出现的确切位置.

They will be logged to your standard system log, or use the error_log directive to specify exactly where you want errors to go.

这篇关于PHP 5禁用严格标准错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆