Skip to content
Advertisement

Php doesn’t show errors sometimes and other times it shows

I have this:

JavaScript

This show error in normal way like this:

JavaScript

But this:

JavaScript

Instead of show the error, gives me HTTP ERROR 500

I’m using php 7.4 as php-fpm

I tried to use only E_ALL instead of E_ALL | E_STRICT

Advertisement

Answer

The reason this is happening is because the parse error is being triggered and stopping the file from being compiled. Because it is not compiled, PHP doesn’t know to set display_errors = On.

You need to modify the php.ini file and set the value there.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement