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!

Debugging my code - How can I find troubled code?

Status
Not open for further replies.

josel

Programmer
Oct 16, 2001
716
US
Writing some code and testing as I go ... very nice except that when code does not work browser screen is totally blank and I do not get anything that tells me the line where code is broken.

What must I set so that it shows me on screen whatever problem was encountered?

Thanks!


Jose Lerebours


KNOWLEDGE: Something you can give away endlessly and gain more of it in the process! - Jose Lerebours
 
I have changed every setting in my php.conf document and I still do not get any message displayed on screen nor logged to file.

I even added this line of code to my script
Code:
error_reporting(E_ALL);

I stopped and restarted my Apache server and nothing still. This kind of makes it hard to troubleshoot if you cannot properly identify the root cause.

Any suggestions?

Thanks,

Jose Lerebours


KNOWLEDGE: Something you can give away endlessly and gain more of it in the process! - Jose Lerebours
 
add this as the first line of your code.

Code:
ini_set("display_errors","on");

this may not work if you have parse errors. In which case you must change the equivalent setting in your php.ini file and then restart apache.

recent distros of php came with short_open_tags set to off. if, like me, you are in the habit of writing php code with short tags
Code:
<?   ?>
rather than their full form equivalents
Code:
<?php ?>
you may find it easier to change this entry in your php.ini file as well.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top