Jump to content

[SOLVED] PHP Error Reporting


Mateobus

Recommended Posts

Hello, I am having a very difficult time getting my errors to show on my page, particularly parse errors.  I have a big script that has a parse error (i don't know where), and it would be much easier to test my script with error reports telling me what the problem is, but instead i just get a white page.  I have played around with various settings, and I have had no luck.  Here is a snippet of the script which is having problems.

 

error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
ini_set('display_errors', '1');
ini_set('display_startup_errors', '1');
ini_set('safe_mode', '');

 

Also, when I run phpinfo(), i get 6143 --not sure what that means.  Thanks in advance

Link to comment
https://forums.phpfreaks.com/topic/78147-solved-php-error-reporting/
Share on other sites

Both - display_startup_errors and safe_mode cannot be set in a script at all.

 

The reason why the other two lines don't help you (they work for everything except fatal parse errors) is because a parse error occurs before the code is executed and those two lines never get executed.

 

To see fatal parse error you either need to check your web server log for errors or turn on display_errors and set the error_reporting level in php.ini or a .htaccess file.

 

For a .htaccess file, use the following -

php_flag display_errors on
php_value error_reporting 6143

The 6143 value is the equivalent of E_ALL, but the constant E_ALL has no meaning outside of php.ini or a php script.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.