PHP not displaying errors even though display_errors = On

前端 未结 17 1611
面向向阳花
面向向阳花 2020-12-13 01:31

I have a Ubuntu server running Apache2 with PHP 5. In the php.ini I set display_errors = On and error_reporting = E_ALL | E_STRICT, but PHP is st

相关标签:
17条回答
  • 2020-12-13 02:27

    I just experienced this same problem and it turned out that my problem was not in the php.ini files, but simply, that I was starting the apache server as a regular user. As soon as i did a "sudo /etc/init.d/apache2 restart", my errors were shown.

    0 讨论(0)
  • 2020-12-13 02:28

    Check the error_reporting flag, must be E_ALL, but in some release of Plesk there are quotes ("E_ALL") instead of (E_ALL)

    I solved this issue deleting the quotes (") in php.ini

    from this:

    error_reporting = "E_ALL"
    

    to this:

    error_reporting = E_ALL
    
    0 讨论(0)
  • 2020-12-13 02:30

    Make sure the php.ini that you're modifying is on the /etc/php5/apache2 folder, or else it won't have any efect...

    0 讨论(0)
  • 2020-12-13 02:32

    I have encountered also the problem. Finally I found the solution. I am using UBUNTU 16.04 LTS.

    1) Open the /ect/php/7.0/apache2/php.ini file (under the /etc/php one might have different version of PHP but apache2/php.ini will be under the version file), find ERROR HANDLING AND LOGGING section and set the following value {display_error = On, error_reporting = E_ALL}.

    NOTE - Under the QUICK REFERENCE section also one can find these values directives but don't change there just change in Section I told.

    2) Restart Apache server sudo systemctl restart apache2

    0 讨论(0)
  • 2020-12-13 02:34

    Though this thread is old but still, I feel I should post a good answer from this stackoverflow answer.

    ini_set('display_errors', 1);
    ini_set('display_startup_errors', 1);
    error_reporting(E_ALL);
    

    This sure saved me after hours of trying to get things to work. I hope this helps someone.

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