Help - Search - Members - Calendar
Full Version: Cgi-bin
Zymic Webmaster Forums > Zymic Free Web Hosting > Zymic Free Web Hosting - General Discussion & Help
Dr.Ankur
please somebody explain me about cgi bin directory , what it is and how it works.
Lou
yeah, someone tell me and him =)
Bread
The cgi-bin is a directory set aside to allow executable files to run within the web server.

So take for example the following script:

CODE
#!/usr/bin/perl

print 'Hello world!';


if placed in a directory that is not the 'cgi-bin', the following would be outputted:

CODE
#!/usr/bin/perl

print 'Hello world!';


So it just outputs the source of the file (in some setups you would just receive it as download which depends on defined mime types), this is not the intended output; However if this script was placed in the cgi-bin, the following would be outputted:

CODE
Hello world!


Which is exactly what the script was intended to do.

The first line is called a 'shebang' and declares the interpreter to be used to parse the following script. Interpreter paths differ on different setups, so it might be '/usr/local/bin/perl' or something similar, if you can execute shell commands, just issue 'whereis perl' or any other interpreter you wish to use and it will provide you with the path.
Lou
nice, thanks for telling.
Locus
How about other scripts reside in cgi-bin folder?
nate
hello, can anyone tell me how to execute command lines, I can't seem to get access to the server and can't find any info on it, using Putty, thanx
Trippin7464
telnet and cgi access are not provided with this host.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.