Jump to content

PHP error_reporting


dave_c00

Recommended Posts

Hello,

I have recently hired a new server and the php.ini file is different to what I usually have.

The display errors section is set to off.

I quite like the idea of this as the server is going to contain mostly my sites so no errors is good.

However when writing scripts I would like to be able to see any errors so I was planning on using ini_set to display them.

I have tried using:
[code]
error_reporting(E_ALL);
ini_set("display_errors", 1);
[/code]
at the top of a script but cannot get any parse or fatal errors displayed just blank pages. I can get Notices displayed but no parse or fatals.

Can anyone help? Maybe I need to put another ini_set before...

I have php version 4.3.9 installed.

Thanks

Dave
Link to comment
https://forums.phpfreaks.com/topic/23539-php-error_reporting/
Share on other sites

the problem with that is that the script needs to be run for it to work - but if there's certain types of error, the script wont run at all and neither will those lines.

what i always do during development is to set up a .htaccess file in my webroot with these four lines:

[code]
php_flag display_errors on
php_flag display_startup_errors on
php_flag log_errors off
php_value error_reporting E_ALL
[/code]

and when i'm done, i just delete the file
hope that helps
cheers
Mark
Link to comment
https://forums.phpfreaks.com/topic/23539-php-error_reporting/#findComment-106867
Share on other sites

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.