CISE Help & Resources
How to Debug CGI Programs
A full description of debugging CGI programs is beyond the scope of this document. What follows are guidelines and CISE-specific details for debugging your Perl scripts.
Contents
Testing Server
All debugging must be done on the testing server,
www-pub. All URLs on this machine will start with
http://www-pub.cise.ufl.edu/.
Note: www-pub is only accessible from
within the CISE network. See Secure Remote Access to CISE
for instructions on how to remotely connect to the network so you can
access that testing server.
Once your script is fully debugged, you can run it on the main CISE web server by using URLs starting with http://www.cise.ufl.edu/ instead of http://www-pub.cise.ufl.edu/. Anyone running scripts on the main web server which cause runaway processes to be spawned, or which fill up the disk space with warnings, or cause other problems may lose access to that machine and will no longer be able to run CGI programs there.
Enable Additional Warnings in Perl
Your Perl scripts can print additional warnings which may help in
tracking down a problem. In the shebang tag at the top of your script,
add the -w switch like so:
#!/usr/local/bin/perl -w
Note: you must remove the -w before running
the program on the main web server. Failure to do so has filled up the
entire disk on the web server with useless warnings on several occasions.
Check the Apache HTTP Server Logs
Information on how to view the error log can be found on the Web Servers help page. Those files may contain information that will help debug the issue.