Jump to content


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


PHP error_reporting

Recommended Posts


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:
ini_set("display_errors", 1);
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.



Share this post

Link to post
Share on other sites
What you got should work, but you could try this instead:

[code]ini_set('error_reporting', E_ALL);
ini_set("display_errors", 1);[/code]

Share this post

Link to post
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:

php_flag display_errors on
php_flag display_startup_errors on
php_flag log_errors off
php_value error_reporting E_ALL

and when i'm done, i just delete the file
hope that helps

Share this post

Link to post
Share on other sites


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.