Tips Debugging CGI programs


 

Some IDEs have support for debugging locally

  • Example: PhPStorm IDE supports debugging of php
  • Follow directions on your IDE support page

 

 

CGI request follower -pluggin for browser

  • Example: Chrome Developer Tools

 

Trying the GET method can make data more visible (like in above developer tool)

Keep the method type on the forms as GET to help with debugging. You will see the data sent in the address line of the browser.


Old style (but still valid): print to log or other files

You can print things out to catch some problems or to figure things out.

 

Look at Log files on Servers

You can look at the log files:

  • Example: Apache has error file and access file apache_error and apache_access (ask for location from your admin)
    • Search for your login name to see if there are any errors related to content served from your account.

 

Syntax errors should be caught with a good IDE development tool

 

  • Example: PHPStorm has built in syntax checking
  • Example: PHP on command line

    For PHP can check syntax of PHP program.

    php -l File.php

 

 


 
© Lynne Grewe