Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I get PHP to tell me whats wrong?

Status
Not open for further replies.

jsweet

Technical User
Jul 28, 2006
88
US
I'm new to PHP so I hope this is an easy question. Basically if I make a syntax error like leaving a ; of a statement or using an If statement with out an ending } I get a blank html page.

Instead I would like to get a PHP page that says there was some error on line (x). Is there a way I can turn this functionality on?

Thanks in advance
 
in your code, add
Code:
ini_set('display_errors',1);
error_reporting(E_ALL|E_STRICT);

I don't recommend this for public systems, as it could be a security problem.

you can also do this in your php.ini file
Code:
display_errors = On
error_reporting = E_ALL

Personally, I just check my error_log from apache.

-----------------------------------------
I cannot be bought. Find leasing information at
 
For development machines, use the php.ini setting. As the in page settings will not get applied if you have a fatal error.





----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
thank you both. this was exactly what I needed.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top