It's hard to debug a CGI program. After all, you're not actually running it (unless your name is httpd). But when those bugs show up, a little creative thinking will help you overcome that limitation. Let's talk about a technique I've found to be very useful for debugging CGI programs written with the PHP scripting language. While the same basic idea could be applied to CGI programs written in other languages, the class extensions to PHP make the process a little more elegant, as well as easy to apply to many CGI scripts without a lot of extra work. (If you're not familiar with PHP, see the box titled "What Is PHP?")
展开▼