php does not show error messages

1

Good morning. At the beginning of my php page I put:

ini_set("display_errors",1);
ini_set("display_startup_errors",1);
error_reporting(E_ALL);
ini_set("log_errors_max_len",2048);

After these directives, I gave a phpinfo (). display_errors and display_startup_erros are marked as On in the Local Value column. The error messages are not displayed at all. I took the semicolon from the end of a line and the page goes blank, not showing the error message that would help me locate the problem.

I've already tried switching from php5.6 to php 7 but that did not help. I'm running this page hosted on Locaweb.

Can anyone help me, please? Thank you so much.

    
asked by anonymous 19.05.2017 / 16:46

1 answer

0

Instead of trying to display errors on the page, considering that it is a web host, the most recommended is to direct the errors to a file and even custom messages like below:

ini_set("log_errors", 1);
ini_set("error_log", "/caminho/onde/guardar/php-error.log");
error_log( "POST: " . print_r($_POST, true) );

So you do not run the risk of leaving debugging data on the page by accident.

    
19.05.2017 / 17:02