Jump to content


Photo

PHP error_reporting


  • Please log in to reply
2 replies to this topic

#1 dave_c00

dave_c00
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 10 October 2006 - 01:44 PM

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:
error_reporting(E_ALL);
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.

Thanks

Dave

#2 Daniel0

Daniel0
  • Staff Alumni
  • Advanced Member
  • 11,956 posts

Posted 10 October 2006 - 02:15 PM

What you got should work, but you could try this instead:

ini_set('error_reporting', E_ALL);
ini_set("display_errors", 1);


#3 redbullmarky

redbullmarky
  • Staff Alumni
  • Advanced Member
  • 2,863 posts
  • LocationBedfordshire, England

Posted 10 October 2006 - 02:56 PM

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
cheers
Mark
"you have to keep pissing in the wind to learn how to keep your shoes dry..."

I say old chap, that is rather amusing!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users