ID #1426

Why aren't my CGI scripts being executed ?

 
     
 

Please proceed as follows when troubleshooting:

  1. Check whether your Webspace tariff contains CGI support. Some low priced tariff bundles don't support CGI. CGI support is enabled automatically by our systems, depending on the bundle.
  2. Check whether the CGI scripts have been copied to the directory /www/cgi-bin. CGI scripts always have to be transferred in Bit Code für die Kodierung von Zeichen. Doch da u.a. deutsche Umlaute in diesem Zeichencode nicht enthalten sind, gibt es immer wieder Probleme beim Austausch von Texten (z.B. bei Email), in denen Zeichen vorkommen, die nicht im ASCII definiert sind.">ASCII mode!
  3. Check the file endings: .cgi or .pl are allowed.
  4. Check whether the CGI scripts are executable. At least one "chmod 555" (resp. "rxrxrx") has to be made for the scripts to be executable by the web server.
  5. Check whether you are calling the CGI script from the website correctly. Please always state "/cgi-bin/meincgiskript.pl" as path.


Frequent error messages of the server or in the log file:

"Internal Server Error"
CGI is enabled and addressed correctly but something is wrong with the CGI script itself.


That could be caused by the following:

  • missing or wrong file permissions; set these correctly with your FTP program for each CGI script. You may set them to "777" for testing purposes (Warning: this is a security gap!).
  • the script already has delivered output to the client before the header has been sent completely. Please check the script for premature output instructions in this case (e.g. "print" commands).

"You don't have permission to access /cgi-bin/meinskript.pl on this server."
CGI ist enabled and can be communicated with correctly but errors occured.


That could be caused by the following:

  • missing or wrong file permissions; set these correctly with your FTP program for each CGI script. You may set them to "777" for testing purposes (Warning: this is a security gap!).

"Premature End of Script Headers"
CGI is enabled and can be communicated with correctly but something is wrong with the CGI script itself.

  • There are special characters in the script which cause the script interpreter to abort.:

    Background:
    Such special characters are line breaks for instance that are pasted automatically when a CGI script is edited with the editor (under Windows for example). These Windows-specific line breaks are treated as special characters under Unix/Linux and cause errors during the processing of the script.

    Troubleshooting:
    Open the script under Windows (e.g. with Windows Script Editor that comes with every MS Office installation or any other editor that is capable of conducting correct line breaks (\n)).

Tags: cgi, script, webdesign

Verwandte Artikel:

Kommentieren nicht möglich