Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
March 11, 2008, 12:36 am
rate this thread
Re: Web host has PHP 5 "as a module"...what's that?
The Apache web server can process a scripting language in two different
1. CGI: when a script file is requested, Apache runs an
external interpreter, captures its output, and sends that
output to the client; or
2. Module: when Apache first starts, it loads the interpreter
as a plugin; when a script file is requested, Apache passes it
to the plugin and sends the output to the client.
Each approach has its advantages and disadvantages. A buggy module can
crash Apache -- CGI isolates the interpreter as a separate process,
protecting the web server. But CGI is a lot slower than running the
interpreter as a module, because the interpreter needs to re-initialise
itself (e.g. reading config files) for every request.
Generally speaking, the PHP module is quite solid, so you probably don't
need to worry about bugs in it crashing Apache.
There's a module available called "FastCGI" which aims to provide an in-
between solution too. An external process is used, but the same external
process is used to handle multiple requests.
For some non-Apache web servers (e.g. Xitami), there may not be a module
available, so running PHP as CGI or FastCGI may be the only option. But
most web hosting packages tend to offer either Apache or IIS, which both
have PHP modules.
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 22.214.171.124-mm-desktop-9mdvsmp, up 41 days, 16:03.]
The Semantic Web