error_reporting(E_ALL)不产生错误 [英] error_reporting(E_ALL) does not produce error

查看:113
本文介绍了error_reporting(E_ALL)不产生错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的php脚本-

<?php
  error_reporting(E_ALL);
  echo('catch this -> ' ;. $thisdoesnotexist);
?>

如果要执行,显然应该显示一些内容.

Which obviously should show something if it were to be executed.

我看到的只是一个空白页面.为什么error_reporting(E_ALL)无法正常工作?

All I see is an empty page. Why is error_reporting(E_ALL) not working?

<?php
  ini_set("display_errors", "1");
  error_reporting(E_ALL);
  echo('catch this -> ' ;. $thisdoesnotexist);
?>

也没有帮助.我得到的只是一个空白页.

Does not help either. All I get is an empty page.

我去过php.ini并设置了display_errors = Ondisplay_startup_errors = On. 什么都没发生.

I've been to php.ini and set display_errors = On and display_startup_errors = On. Nothing happens.

推荐答案

您的文件语法错误,因此未解释您的文件,因此未更改设置,并且页面为空白.

Your file has syntax error, so your file was not interpreted, so settings was not changed and you have blank page.

您可以将文件分成两个.

You can separate your file to two.

index.php

index.php

<?php
ini_set("display_errors", "1");
error_reporting(E_ALL);
include 'error.php';

error.php

error.php

<?
echo('catch this -> ' ;. $thisdoesnotexist);

这篇关于error_reporting(E_ALL)不产生错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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