How to identify the error in PHP code by Chrome?

1

I write my code in Sublime and when I try to run the chrome screen it goes blank. Since a comma can cause a lot of problems, I keep rereading and rereading code for errors. Why does not my Chrome show errors?

    
asked by anonymous 30.01.2018 / 11:50

2 answers

1

PHP is interpreted by the web server (apache, nginx) and its response is delivered to the caller (browser, ajax). To see any errors that may happen, you must enable the display of PHP errors, in the file php.ini there is a directive called display_errors change its value to 1 or On . So when errors occur they will be displayed on screen.

    
30.01.2018 / 12:03
1

Place at the beginning of your code:

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

If you have error_reporting (0), comment:

//error_reporting(0);
    
30.01.2018 / 12:06