方法1: 
修改php.ini文件中的下列属性修改一下

display_errors = Off

error_reporting = E_ALL

方法2: 
在php文件开头写入:<?php error_reporting(0); ?>