CGI scripts have always mystified me
Filed under: Software and Technology by HariPosted at 17:39 IST (last updated: Wed, 16 Jul 2008 @ 20:38 IST)
Having used PHP as the logical choice for web development, I've always been a little mystified by cgi-bin scripts and never bothered to learn how they work. But no longer.
CGI scripts are nothing but scripts or executable programs. Apache simply executes them and renders the results. Of course, because every CGI program is an external application and requires the web server to start a new process, it makes the whole thing very processor intensive. The modern method of embedding scripts in web pages (most popularly PHP/ASP) which can be directly interpreted by Apache is a far more efficient method and I suppose more logical from a web designer's point of view.
However, there are still a few advantages to CGI scripts: you can use whatever language you wish to (plain shell scripting, Perl, Python and even compiled C executables). This offers many more options to the developer. Also in many cases CGI scripts are not limited to server "modules" and can directly use the underlying Operating System's functionality.
Rather than reinvent the wheel however, I'll point you to Apache's CGI tutorial which is a must read for any webmaster, web developer or server administrator.
Yes, CGI can be intimidating and complex CGI scripts can be a headache to maintain, but it's nevertheless useful to have an idea about how they work since so many websites still utilize this method of delivering dynamic content.
14 comment(s)
Leave a comment »Comment by (visitor) on Sat, 22 Mar 2008 @ 18:29 IST #
Comment by hari (blog owner) on Sat, 22 Mar 2008 @ 18:51 IST #
Comment by (visitor) on Sun, 23 Mar 2008 @ 02:32 IST #
Comment by hari (blog owner) on Sun, 23 Mar 2008 @ 07:48 IST #
Comment by drew (visitor) on Sun, 23 Mar 2008 @ 18:42 IST #
Comment by hari (blog owner) on Sun, 23 Mar 2008 @ 20:34 IST #
Comment by od (visitor) on Sun, 23 Mar 2008 @ 21:28 IST #
Comment by hari (blog owner) on Mon, 24 Mar 2008 @ 07:42 IST #
Comment by RT Cunningham (visitor) on Mon, 24 Mar 2008 @ 11:45 IST #
Comment by hari (blog owner) on Mon, 24 Mar 2008 @ 12:43 IST #
Comment by (visitor) on Mon, 24 Mar 2008 @ 21:29 IST #
Comment by hari (blog owner) on Mon, 24 Mar 2008 @ 21:39 IST #
Comment by Joshua Goodwin (visitor) on Wed, 2 Apr 2008 @ 00:14 IST #
Comment by hari (blog owner) on Wed, 2 Apr 2008 @ 08:29 IST #