596Part IIIAdvanced Features and TechniquesFigure 32-4:Environment (Web design rates) variables in

596Part IIIAdvanced Features and TechniquesFigure 32-4:Environment variables in the Variables paneSummaryThis chapter attempted to show you where bugs come from and how to catch them whenthey find their way into your PHP programs. You saw that there are a number of resourcesavailable to you as you attempt to track down problems many of them native to the PHPlanguage or otherwise freely available. First among your bug-catching tools is the bug-reporting capability of PHP itself. If you config- ure php.inicorrectly and this chapter showed you how you can get precise reports ofthe line numbers on which the interpreter is running into trouble. Depending on your secu- rity requirements, you can have the troubleshooting information conveniently displayed withthe rest of the output (typically in the browser window), recorded in a log file, or both. Youalso can keep an eye on the HTTP logs maintained by your Web server. These will help youmonitor GETrequest data and spot requests for nonexistent files. Additionally, you should use PHP language constructs that make your programs more self- diagnostic and troubleshooter-friendly. Functions like openlog()and syslog()will recordevent information when problems occur and can really help with tracking down problems. Inan even simpler strategy, you can use carefully placed print()and (especially) print_r() statements to reveal what s going on in your code as it executes.
We highly recommend you visit web and email hosting services if you need stable and cheap web hosting platform for your web applications.

Leave a Reply