error_reporting(E_ALL) does not produce error

前端 未结 6 535
一整个雨季
一整个雨季 2020-11-30 05:18

This is my php script-

 \' ;. $thisdoesnotexist);
?>

Which obviously should

相关标签:
6条回答
  • 2020-11-30 05:58

    In your php.ini file check for display_errors. I think it is off.

    <?php
    error_reporting(E_ALL);
    ini_set('display_errors', TRUE);
    ini_set('display_startup_errors', TRUE);
    
    0 讨论(0)
  • 2020-11-30 06:07

    That error is a parse error. The parser is throwing it while going through the code, trying to understand it. No code is being executed yet in the parsing stage. Because of that it hasn't yet executed the error_reporting line, therefore the error reporting settings aren't changed yet.

    You cannot change error reporting settings (or really, do anything) in a file with syntax errors.

    0 讨论(0)
  • 2020-11-30 06:09

    you can try to put this in your php.ini:

    ini_set("display_errors", "1");
    error_reporting(E_ALL);
    

    In php.ini file also you can set error_reporting();

    0 讨论(0)
  • 2020-11-30 06:14

    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

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

    error.php

    <?
    echo('catch this -> ' ;. $thisdoesnotexist);
    
    0 讨论(0)
  • 2020-11-30 06:17

    In your php.ini file check for display_errors. If it is off, then make it on as below:

    display_errors = On
    

    It should display warnings/notices/errors .

    Please read this

    http://www.php.net/manual/en/errorfunc.configuration.php#ini.error-reporting

    0 讨论(0)
  • 2020-11-30 06:25

    turn on display errors in your ini

    http://www.php.net/manual/en/errorfunc.configuration.php#ini.display-errors

    0 讨论(0)
提交回复
热议问题