We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now


setting up php environment

Medium Priority
Last Modified: 2013-12-25
what is the difference on setting up php environment as CGI or as a module to a web server
Watch Question

Quoted from http://www.faqts.com/knowledge_base/view.phtml/aid/111:

"CGI is just an interface to execute a program. When you use php this way, the web server starts up the php binary and feeds it the php script (more or less...). PHP starts up, parses the file, returns the static html output and then shuts down.

With the module, php is no longer a seperate program. It is linked with apache so that apache and php run together as a single program. This way, when the webserver get's a request for the script, apache interperates it natively. Saves the high overhead of starting and killing the interperator each time."

You can read some more in these:

Hope it helps

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Top Expert 2009

As a seperate program, apache will start the php binary program, and tell it what script to run.  Apache will provide it some information (the CGI environment).  The php program will write to standard ouput the output from the script.  Apache will take that output, and send it to the client (eg: web browser).

As a module, the php interpreter behaves like a function that apache can call.  When used like this, the main php interpreter is loaded into memory once, and the processing of the php scripts happens inside the module.

Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.