Hi, My program stuck sometimes and I would like to know how to trace each line of code without inserting tons of print or echo to help me debug. Thanks for any help in advanced.
What's you error reporting set at? You can put this at the top of the page to report all errors. error_reporting(E_ALL); Let me know if you were referring to something else.
Hi, I have these in the beginning of my file. ini_set('display_errors', 1); error_reporting(E_ALL & ~E_NOTICE); My program works randomly. Sometimes it works and sometimes doesn't even though it is reading the same data (a zip file). All I did is testing the same code over and over. But sometimes it finished reading everything but sometimes it doesn't. It is like sometimes I got lucky and sometimes I didn't and no error message. I just want to know why same codes and same zip file but results differ randomly. I thought tracing it line by line might help to debug.
How long does the script take to process. I've seen scripts simply stop with no error when they timeout while uploading/processing a file.
Keep in mind some hosts block the error_reporting() command and instead they echo it into a local text file, often called error_log.
The max execution time is set to 30 (assume 30 seconds) in the php.ini. I know in the past I had gotten error message exceeding max execution time when it ran too long... But I have not gotten any error like that lately and the program just stopped in the middle. When it worked the time was actually longer than 30 seconds. It is a small zip file so it took around 1 minute. So this really confuses me.
Hi, I did get some php or MYSQL error messages before so I think our hosting company is not blocking the error reporting.
there's also a plugin for firebug (under mozilla / firefox) called firePHP - it allows you to output variables, objects and functions to the firebug console through x-headers its pretty slick and VERY useful for debugging - needs php 5+ though.
Thanks a lot. I will try that later. So far, I changed the sequence of my codes and seems to be fine. Hope it stays that way.