What is Common Gateway Interface (CGI)? -


cgi common gateway interface. name says, "common" gateway interface everything. trivial , naive name. feel understood , felt every time encountered word. frankly, didn't. i'm still confused.

i php programmer web development experience.

user (client) request page ---> webserver(->embedded php interpreter) ----> server side(php) script ---> mysql server.

now php script can fetch results mysql server & matlab server & other server.

so, php script cgi? because interface between webserver & other servers? don't know. call cgi, technology & other times call cgi program or other server.

  • what cgi?

  • whats big deal /cgi-bin/*.cgi? what's this? don't know cgi-bin directory on server for. don't know why have *.cgi extensions.

  • why perl comes in way. cgi & perl (language). don't know what's these two. time keep hearing these 2 in combination "cgi & perl". book great example cgi programming perl. why not "cgi programming php/jsp/asp"? never saw such things.

  • cgi programming in c, confuses me lot. "in c"?? seriously?? don't know say. i'm confused. "in c"?? changes everything. program needs compiled , executed. entirely changes view of web programming. when compile? how program gets executed (because machine code, must execute independent process). how communicate web server? ipc? , interfacing servers (in example matlab & mysql) using socket programming? i'm lost!!

  • people cgi deprecated , isn't in use anymore. so? latest update?

once, ran situation had give http put request access web server (apache httpd). long back. so, far remember did:

  1. edited configuration file of apache httpd tell webserver pass http put requests put.php ( had write php script)

  2. implement put.php handle request (save file location mentioned)

people said wrote cgi script. seriously, didn't have clue talking about.

  • did write cgi script?

i hope understood confusion is. (because myself don't know i'm confused). request guys keep answer simple possible. can't understand fancy technical terminology. @ least not in case.

edit:

i found amazing tutorial "cgi programming simple!" - cgi tutorial, explains concepts in simplest possible way. after reading article may want read getting started cgi programming in c supplement understanding actual code samples. i've added these links tutorial wikipedia's article: http://en.wikipedia.org/wiki/common_gateway_interface

cgi interface tells webserver how pass data , application. more specifically, describes how request information passed in environment variables (such request type, remote ip address), how request body passed in via standard input, , how response passed out via standard output. can refer cgi specification details.

to use image:

user (client) request page ---> webserver ---[cgi]----> server side program ---> mysql server.

most if not all, webservers can configured execute program 'cgi'. means webserver, upon receiving request, forward data specific program, setting environment variables , marshalling parameters via standard input , standard output program can know , for.

the main benefit can run executable code web, given both webserver , program know how cgi works. that's why write web programs in c or bash regular cgi-enabled webserver. that, , programming environments can use standard input, standard output , environment variables.

in case used another, specific php, means of communication between scripts , webserver, this, mention in question, embedded interpreter called mod_php.

so, answering questions:

what cgi?

see above.

whats big deal /cgi-bin/*.cgi? whats this? don't know cgi-bin directory on server for. don't know why have *.cgi extensions.

that's traditional place cgi programs, many webservers come directory pre configured execute binaries there cgi programs. .cgi extension denotes executable expected work through cgi.

why perl comes in way. cgi & perl (language). don't know whats these two. time keep hearing these 2 in combination "cgi & perl". book great example cgi programming perl why not "cgi programming php/jsp/asp". never saw such things.

because perl ancient (older php, jsp , asp came being when cgi old, perl existed when cgi new) , became famous being language serve dynamic webpages via cgi. nowadays there other alternatives run perl in webserver, mod_perl.

cgi programming in c confuses me lot. in c?? seriously?? don't know say. i"m confused. "in c"?? changes everything. program needs compiled , executed. entirely changes view of web programming. when compile? how program gets executed (because machine code, must execute independent process). how communicate web server? ipc? , interfacing servers (in example matlab & mysql) using socket programming? i'm lost!!

you compile executable once, webserver executes program , passes data in request program , outputs received response. cgi specifies 1 program instance launched per each request. why cgi inefficient , kind of obsolete nowadays.

they cgi deprecated. no more in use. so? latest update?

cgi still used when performance not paramount , simple means of executing code required. inefficient stated reasons , there more modern means of executing program in web enviroment. famous fastcgi.


Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -