tags:

views:

120

answers:

4

Ive seen a folder called cgi-bin quite long while using apache.

How do scripts help me?

how can i use them?

I've used php and ajax only for web development!

+2  A: 

Here you go. Sigh. Thanks for helping us all improve our rep though.

Tarydon
+1  A: 

This is a great tutorial on CGI.

Annie
+1  A: 

cgi-bin stands for CGI binary. To be honest, if you're acquainted with PHP already then you've likely little need for old-fashioned CGI scripts.

Will Vousden
+2  A: 

G'day,

A web server, e.g. Apache, just sends back static content is response to a client request for content. For example a request for http://www.myserver.com/index.html typically causes the server to open the file and return the content of the file wrapped with the relevant http components.

Basically CGI is a technique for generating such web pages dynamically via other applications which are run by the web server on an as-needed basis.

The directory cgi-bin is typically used to house the scripts being run.

Though it's heavily focused on Perl The book "CGI Programming with Perl" has an excellent intro about CGI.

Edit: As asked in the comments below, "if PHP can take care of dynamic content, then what's the need for CGI". There's a few points here.

  1. out of the box, PHP can be pretty slow. CGI, especially in its mod_perl guise, or when using app's built in compiled languages,
  2. PHP doesn't have very strong error handling, but this can be worked around,
  3. I don't think that there's real support for ASP, Windows app's or DB's, and
  4. PHP security is a bit of a worry, e.g. having register_globals enabled, and PHP's flaws are extremely well known.

The design of the PHP language itself also contains many inconsistencies, e.g.

  • a fairly useless object model,
  • scoping is fairly bad,
  • inconsistent naming, and
  • poor organisation of the standard library.

I believe that PHP5 goes a long way to improving these points.

While security is always a concern, with CGI implementations you are able to minimise the security problem in well publicised ways.

HTH

cheers,

Rob Wells
thanks for the reply rob :)php can take care of dynamic content rite?then wats the need for cgi???
dineshbabu
@dineshbabu, hope I answered your question with the above edit. (-:
Rob Wells
thanks again.. :D
dineshbabu