in reply to Mason - debug output?

Print to STDERR and look in your web server's error logs.

If there is too much other junk in there, then open up a log file and write to that instead. Oh, and clean up your error log. Error logs are supposed to be fairly clean so that you can notice errors.