Habblitar errors in PHP

4

I uninstalled XAMPP to install PHP in IIS but I realize that errors are not enabled. When a syntax error or some other type of code error occurs, the page does not notify you and simply sends an error 500.

How can I enable errors in PHP? Be warnings, errors and so on.

    
asked by Guillermo Ricardo Spindola Bri 02.08.2016 в 18:08
source

3 answers

4

Inside your file at the beginning add:

<?php
    ini_set('display_startup_errors', 1);
    ini_set('display_errors', 1);
    error_reporting(-1);
...
...
...
?>

You can see the meaning of the configuration directives here in the documentation in Spanish:

link

    
answered by 02.08.2016 в 18:30
0

I always use this:

ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
    
answered by 02.08.2016 в 19:06
0

The easiest way is:

error_reporting(-1);

or also putting the following in your php.ini :

display_errors = On
    
answered by 04.01.2018 в 11:20