PHP does not return errors at all

I am running PHP and nginx and I am using the production version of php.ini. Therefore, the variable display_error is set to Off, and there is a good reason why I want to do this. But for some files I need to enable error reporting. I used ini_set to enable error reporting. But a simple piece of code, for example:

<?php
error_reporting(E_ALL);
ini_set("display_errors", 1);

echo "hi"errorrrrr
?>

does not track error. It simply returns the error message "HTTP Server 500 Internal Server". What to do to enable error reporting?

+3
source share
5 answers

The answer I was looking for is in the comments for this answer: PHP doesn't return errors at all

, , , , PHP . , log_errors php.ini.

- cmptrgeekken 16 '10 18:16

-1

log_errors . error_log , .

+1

, PHP , . script ! .

, . , PHP CGI, apache, ini - php.ini.

, , phpinfo(); , Server API.

, apache error_log , 500, , .

+1

ini .htaccess.

, PHP, - .

+1

php, . , ​​. include .

error_reporting(E_ALL);
ini_set("display_errors", 1);
include 'some other file with a parse error.php';

script. , , include, script .

+1

Source: https://habr.com/ru/post/1737178/


All Articles