How to have PHP display errors? (I've added ini_set and error_reporting, but just gives 500 on errors)

后端 未结 7 1532
花落未央
花落未央 2020-12-08 19:39

So, I don\'t really have any errors in my current web page, but I want to be able to see an error when they pop up, instead of the HTTP 500 error page. I googled around a bi

7条回答
  •  渐次进展
    2020-12-08 20:05

    Syntax errors is not checked easily in external servers, just runtime errors.

    What I do? Just like you, I use

    ini_set('display_errors', 'On');
    error_reporting(E_ALL);
    

    However, before run I check syntax errors in a PHP file using an online PHP syntax checker.

    The best, IMHO is PHP Code Checker

    I copy all the source code, paste inside the main box and click the Analyze button.

    It is not the most practical method, but the 2 procedures are complementary and it solves the problem completely

提交回复
热议问题