Jump to content


Photo

PHP display errors


  • Please log in to reply
4 replies to this topic

#1 Mateobus

Mateobus
  • Members
  • PipPipPip
  • Advanced Member
  • 95 posts

Posted 10 October 2006 - 07:48 PM

I am trying to configure my php.ini file so that it displays error. I am not too familiar with this file, but i think that these two lines have someithing to do with displaying errors:

error_reporting = E_ALL & ~E_NOTICE
display_errors = On

is there any other reason why errors would not display?

#2 GremlinP1R

GremlinP1R
  • Members
  • PipPipPip
  • Advanced Member
  • 62 posts
  • LocationSouth Africa

Posted 10 October 2006 - 07:50 PM

That all depends on how you write your script
if you dont tell it to show error if failed then it will not show anything.

#3 Mateobus

Mateobus
  • Members
  • PipPipPip
  • Advanced Member
  • 95 posts

Posted 10 October 2006 - 08:31 PM

How do i tell it to show errors then. Also, I have written hundreds of scripts where it showed me errors without me explicitly telling it to do so.

#4 GremlinP1R

GremlinP1R
  • Members
  • PipPipPip
  • Advanced Member
  • 62 posts
  • LocationSouth Africa

Posted 10 October 2006 - 08:40 PM

Well I know on my php server I'm running on my pc for ofline viewing I have to uses the "or die()" statement to get any errors.

#5 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 11 October 2006 - 01:28 PM

Try something like this:
<?php

if($var == bla)
  echo "var is bla";
}

?>
Obviously I have deliberatly leftout the opening curly bracket to force an error inbthe code. You should get an error like the following:
Parse error: parse error, unexpected '}' in path/to/your/file/here]on line 5

If you mean notice errors, which are not errors. You'll want to remove & ~E_NOTICE from the error_reporting directive in the php.ini




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users