My script doesn't work
Cgi-scripts for guestbooks or counters may not working every time, and this article will give some tips on how to figure out what's wrong.
Possible solutions
- Check if the permissions for the different files are correct. Some need to be write-able and others executable.
- Make sure your script starts with #!/usr/bin/perl (if it is perl you're using)
- Double-check that you've put the script in its own directory and that the .htaccess-file is correct. See this page for more information.
- Log on to login.stud.ntnu.no with Secure Shell(ssh) and try running your script in the terminal window.
- Run the script from an xterm as see if you get any error messages.
- Make sure your script send the correct headers, you can't start sending just <HTML> etc, you have to send at least one header before the html-code. For Perl: print "Content-type: text/html\n\n";. For a shell-script: echo -e "Content-type: text/html\n"
- Close to 99% of the time, the solution to the problem lies in whatever error message you get, so make sure you read those carefully.
If it is not your own script:
- Read any README or INSTALL files that came with the script.
- Try contacting the person who made the script or use another one.
If it is still not working
If your script still doesn't work, something must be wrong with it. Remember that is has to be written in Perl or SH; or a compiled program.
Resources:
- Yahoo's CGI resources.
- Introduction to Perl. Perl is the preferred language for CGI scripts.
- SiT Tapir's books on CGI. You want CGI for UNIX, not for NT
| Språk: | Kommentarer: | 0 | Aid: | 557 | Brukervurdering: |
|
|
| Sist oppdatert: | 2007-08-06 | Forfatter: | livermor | Lest: | 191 ganger |