LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Setting up PHP in CGI in RHEL4 (https://www.linuxquestions.org/questions/linux-newbie-8/setting-up-php-in-cgi-in-rhel4-669159/)

RMLinux 09-11-2008 05:25 AM

Setting up PHP in CGI in RHEL4
 
hi, guys

How can I setup in cgi not in module my php using apache?
which is the most safe cgi or module.

Thank you.

trickykid 09-11-2008 09:59 AM

You're question isn't very clear. You want to use PHP and CGI or one or the other? Exactly what is it that you want to do?

sundialsvcs 09-11-2008 09:29 PM

I think I understand the question ...

Most CGI-support languages (Perl, Python, Ruby and so-on) offer two ways to integrate themselves with Apache.
  1. One way is that "they don't." Apache simply starts an instance of the language to handle the request, each time a request comes in.
  2. The other way is with an Apache "module," which in-effect incorporates the interpreter into the Apache environment. (In effect, Apache invokes the language-interpreter as a subroutine...)
Which is "safer?" "Better?" There is no blanket answer. But I will say that most of the sites I've worked on lately actually use the first scenario. Either Apache invokes a separate process to handle the request, or it passes the request to a separate external program. Kinda surprising but it actually works quite well.

You see, in actual practice the interpreter's memory-segments (and those of the many related-files) are probably going to be paged-in with the very first request and ... in any reasonably memory-equipped computer ... they're just going to stay there, just because they can. Creating and destroying process-table entries is fairly cheap to do when "what you want to execute" is already in-memory.


All times are GMT -5. The time now is 04:55 PM.