php parse errors won’t show

If you disable display_errors in php.ini, and later enable it in your PHP script using ini_set(), it will only be enabled after the line containing that ini_set() call has been executed.

Parse errors occur before the PHP script even starts — when the PHP file is parsed (hence the “parse error” name).

Which means they occur before your ini_set() has even a chance of being executed — which means that, in your case, display_errors is not enabled when the parse error occurs ; and, as a consequence, you don’t get anything displayed.

Leave a Comment