CGI
Q: What is CGI?
A: Stands for "Common Gateway Interface". CGI is a specification for data exchange between a Web server and a program. Many programming languages can be used with CGI, but the most common is Perl. CGI programs add scripting and database interactivity to web pages, and is the most common way that Web servers interact dynamically with users.
Q:What programming languages are used for writing CGI script?
A: Shell, Perl and PHP.
Q: What does Error 500 mean?
A: It means that a request for an URL has triggered a fault with the Web server. It is likely that a server configuration change, CGI script or other server side application has caused a fault. More details about Error 500 can be read here: logs/error_log.
Q: What are some typical errors?
A:
- Make sure that the script handler is right, for example the fist line of the Perl script must be like that:
#!/usr/bin/perl
- The Perl script in ASCII mode must be uploaded to the server in ASCII mode. For example, if you upload a script via CuteFTP software, it transfers files with .pl and .cgi extension by default in ASCII. In the FTP/Transfer Type menu, you must use the "auto" option. If you use Far Manager, you have to place a check by ASCII.
- Install file script attributes on the server as 755 (corresponding to: rwxr-xr-x). In CuteFTP, click the file name with the mouse right button and choose Change File Attribute. In Far Manager, choose a file name and press Ctrl-A.
- Make sure that there are no syntactic mistakes in the script. The Perl script can be checked on the server. Enter perl -c scriptname.pl via ssh.
- If your script creates files itself, check the record rights in the directory.
- The script output in response to an HTTP request should begin with the line:
Content-type: text/html\n\n
and then the HTML code.
- 7. You still see the error on the screen. It may occur because of cached information on the proxy server of your provider. Try to rename the script or start up new parameters, for example:
http://mydomen.com/cgi-bin/test.pl?tmp=3457
Here is the script that displays "Hello world" on the browser's screen.
#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "Hello world";
The list of installed libraries is available in "Servers". If there are no necessary libraries, you can create a request in the control panel or contact tech support.
FAQ
|