PHP不会显示任何错误
发布时间:2020-12-13 22:13:01 所属栏目:PHP教程 来源:网络整理
导读:这是我的代码: echo 'foo';error_reporting(E_ALL);echo 'this line doesnt end in a semi colon'echo 'i should get an error here'; 当我运行这个时,我没有得到任何错误. 不知道这是怎么回事? 解决方法 ini_set('display_errors',1); 请注意,如果你在具
这是我的代码:
echo 'foo'; error_reporting(E_ALL); echo 'this line doesnt end in a semi colon' echo 'i should get an error here'; 当我运行这个时,我没有得到任何错误. 不知道这是怎么回事? 解决方法ini_set('display_errors',1); 请注意,如果你在具有语法错误的文件中执行此操作,它将无法工作,因为它永远不会被执行.你也可以在php.ini中设置为true(不建议用于生产服务器),或者如果你在.htaccess中使用Apache,则: php_flag display_errors 1 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |