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. :-)
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.