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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.