First of all you have to know that your server sent error messages to the standard error file (usually the screen), but if you can't see these messages, you have to check the server's log.FAQs - Q. Why the server replies: '404 not found'?
- A. Maybe the URL specified isn't correct
- Q. Why the server replies: '403 access forbidden'?
- A. Execution file's permission not granted. You must change the access file's permissions. In fact a CGI script is an executable file, so your script file must be executable. On Unix systems you have to use the 'chmod' command to change the access file's permission. Your server can run as 'nobody' or using your own UID (User IDentifier). In the first case you can set: 'chmod +x yourscript.cgi'. In the second case you can set: 'chmod u +x yourscript.cgi'
- Q. Why the server replies: 'malformed header from script'?
- A. Have you put the 'Content-type' header? That line is needed
- Q. Why the server replies: '500 server error'?
- A. Well, there are a lot of reasons to receive this message, because this is a generic error message, so maybe that:
- Execution permissions not set correctly (see the previous question)
- Bad interpreter line: you have forgotten this first necessarly line: #!/usr/bin/perl. However your path maybe different, so you have to know where the PERL interpreter is located.
- Syntax error in script: check the standard error or the server's log
- Missing required file: you have requested a library by means of 'require' or 'use', but that library can't be found.
- Runtime error in script: the script caused an execution error (for example, a file not found, division by zero and so on)
- Invalid HTTP header sent: the first output line sent by the script must always be a valid HTTP header, usually: Content-type: text/html
- Q. Why the browser says: 'Document contains no data'?
- A. This means: the script sent the right content header, but failed to send any further information. Possible causes:
- Script error
- Server timeout
- No output sent by your script
- Q. Why the browser display the script's text instead of executing it?
- A. Maybe that you have installed the script in the wrong place or you have given it the wrong name. Maybe you haven't installed your script inside of the 'cgi-bin' directory, or maybe you named the script without the 'cgi' suffix. In this case in fact the script will be returned as a normal text file
- Q. Why the browser prompts me to save file when running the script?
- A. Maybe the script sent a wrong Content-type header. In fact in this case your browser won't be able to recognize the right format (type 'unknown') and ask you if you want to save it
|