php shows no error messages

Asked

Viewed 461 times

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_errors are marked as On in the Local Value column. It turns out that the error messages are not shown at all. I took the period-and-comma at the end of a line and the page is blank, not showing the error message that would help me locate the problem.

I tried changing from php5.6 to php 7 but it didn’t help either. I’m running this page hosted at Locaweb.

Can someone give me a hand, please? Thank you very much

1 answer

0


Instead of trying to display errors on the page, considering that it is a hosting, the most recommended is to direct errors to a file and even custom messages as 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 don’t run the risk of leaving debugging data on the page by accident.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.