Hi,
Well, Ill tell you, I have been programming in Perl for many a year now and, every once in a while, an ISE will nail me for some time too! Here is my checklist:
- Check the #! line of your script against the path to perl. Never assume that because you can run it from the comand line (./script.pl) that it will work in CGI. Your ENV will be different from Apache's (i.e. PATHs). The line should be something like #!/usr/bin/perl or #!/usr/local/bin/perl and never #!perl
- Make sure your script's permissions are set correctly for your configuration. This changes from one setup to the next, but is often something like: RWX R-X R-X. In some configs, it is important to have execute perms on the file.
- IMPORTANT: make sure the script's parent directory does not offer group or others write access (eg. the perms should be RWX R-X R-X). Many mod_cgi configs will not let you execute a script if it is in a dir that offers group or others write access.
- Check your error log. I assume you already have.
- Are you sure you script is generating output. Try putting the following line at the top of your script. If it generates a blank page, then you know your script is being executed and is just not generating content:
BEGIN{ print "Content-type: text/html\n\n" }
On this note, your script may be generating output, just note the proper headers. The headers won't be automatically sent, you have to print them yourself.
This can be a pain sometimes. If I think of anything else, Ill update this note. Good luck!
update: Some spelling errors.
Ted Young
($$<<$$=>$$<=>$$<=$$>>$$) always returns 1. :-)
| [reply] [d/l] [select] |
| [reply] |
That is a standard error message when something has gone wrong. We will need more information than that. Can you show the script? Also, look in your error log for more information about what is happening. Since that error message could be so many things... If you get tired of looking at the error log, you could use something like CGI::Carp to get the errors to the screen. | [reply] |