php parsing error cannot be displayed
P粉237125700
P粉237125700 2023-10-30 14:44:43
0
2
901

I'm running ubuntu 10.04 nginx php-fpm 5.4

If I set display_errors = On in php.ini all errors will be printed. If instead I set it to off and then use ini_set('display_errors, '1'); directly in the script they also show up, but not the parsing errors, just a blank page. I also tried using error_reporting and E_STRICT but I can't find a way!

P粉237125700
P粉237125700

reply all(2)
P粉805107717

A few years after this question was answered, here I am, but I have found a solution to this problem. For the script I'm writing, I create a second script that contains the ini_set() directive followed by the includes of the script I

real

am working on. This is test_run.php

P粉238355860

If you disable display_errors in php.ini and then enable it in a PHP script using ini_set(), it will only execute Enabled after the line containing the ini_set() call.

Parse Error Occurs before the PHP script is started - while parsing the PHP file (hence the term "parse error") .

This means they occur before your ini_set() even has a chance to be executed - which means, in your case, that display_errors are not enabled when parsing Error; therefore, you won't display anything.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template