ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Im a WebDeveloper, recently i hve joined in a company where CGI is used to develop websites, but im new to it, i hve done in java & php but never known about CGi, can any one help me to know this and also tell me where can i get its tutorials, one more i need to know is when i searched for it in google, it says Perl CGI, C++ CGI, C CGI, CGI, is all of them same or different in writing code & its running environment, im confused about CGI please tell me its details, in my company coding is done in c++ and compiled to CGI, so please tell me where can i get this tutorial.
i need to know about,
file handling, cookies, running external command (like shellscript, doscommands) now, as i will be dealing with embedded system with this.
Actually now im using CGI but my confusion starts when i see a CGI code in different manner ie i use C,C++ program to make a CGI ie i will write a code in C/C++ and compile it and i will get a CGI as an executable file but where as some codes are direct as html does they dont need any compiler at all why are they so...
Actually now im using CGI but my confusion starts when i see a CGI code in different manner ie i use C,C++ program to make a CGI ie i will write a code in C/C++ and compile it and i will get a CGI as an executable file but where as some codes are direct as html does they dont need any compiler at all why are they so...
Perl and Python are interpreted languages by design. C/C++ is a compiled language by design.
Software written in an interpreted language exists as a plain text script rather than a binary file. To run that software, you must have a suitable interpreter installed.
To the end user, there is usually no noticeable difference. (except that compiled languages may execute a little faster)
I'm sorry to have to ask this, but I'm too curious not to. How did you manage to get a CGI programming job (and presumably pass the technical interview) while knowing nothing about CGI?
i have passed interview for Web Developer using PHP & java(JSP & Servlets).
in my company we also have embedded systems, once when i saw a proj of it where they used CGI for web interface i just showed few mistakes in code so they handed over that web interface to me and asked few updates in that, without knowledge also i had to do it & i hve suceessfully done it but now i wanted to learn CGI completely so while learning i had these doubts.
Thanks to you all for clearing my doubts...
1. Perl is interpreted languages by design. C/C++ is a compiled language by design.
2. Common Gateway Interface. Python and Ruby are never used for it.
So now i conclude that CGI files can be made using Perl or C/C++.
i have passed interview for Web Developer using PHP & java(JSP & Servlets).
in my company we also have embedded systems, once when i saw a proj of it where they used CGI for web interface i just showed few mistakes in code so they handed over that web interface to me and asked few updates in that, without knowledge also i had to do it & i hve suceessfully done it but now i wanted to learn CGI completely so while learning i had these doubts.
Thanks to you all for clearing my doubts...
1. Perl is interpreted languages by design. C/C++ is a compiled language by design.
2. Common Gateway Interface. Python and Ruby are never used for it.
So now i conclude that CGI files can be made using Perl or C/C++.
...and they can also be made with MANY other programs, INCLUDING Python and Ruby. If you have passed an interview to be a web developer and don't know these things, you are in for a very tough time at your new job.
Also, the word "doubt" and the word "question" mean different things.
If you're "using PHP to build web sites," guess what! You're right now using CGI to do that!
You see, what CGI basically is, is a way to specify that "a particular web-page" consists of a program that is to be executed, with the output of that program being what the user will eventually see. (I could offer a more complete explanation here, but this is the essential idea.)
So ... when you build a web-page "in PHP," that PHP is "a program that is to be executed." The user should never see the PHP source-code: what they see is the output that the PHP code, when executed, produces. And that is what "CGI" ... is.
If you're "using PHP to build web sites," guess what! You're right now using CGI to do that!
Not necessarily. PHP can also be deployed as an Apache module. On Linux, it almost always is.
Python and Ruby are generally never deployed using CGI. Python is deployed using WSGI, and Ruby is usually deployed using the Passenger module (AFAIK for Ruby).
None of these technologies are "CGI". CGI is something very specific.
Granted, a stricter version of "CGI" would imply that the process that serves the web-page content is launched by the (Apache) web server each and every time. Which is one of the "issues" that I decided to try to gloss-over, because it really doesn't matter much in the end. Maybe the programming is built-in to Apache as a module; maybe it's running in a companion process (FastCGI); maybe it's launched every time. But these, to me, are mostly implementation distinctions; variations on "the essential idea," which is: that a program runs (somehow, somewhere), and what you get is its output.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.