PHP as CGI or Apache Module

PHP as Apache module

Running PHP as an Apache module requires web-server module apache mod_php

Advantages

* Faster performance since it is running as part of apache.
* Scripts are executed by server.
* A single config. file for all the scripts (php.ini).
* If need be, you can set PHP configuration variables in the web-server config. file or by using your .htaccess file to specify rules.

Disadvantages

* Scripts are being executed with web-server owners’ privileges, which might lead to some security related problems
* If the scripts run foreign applications (like mail distribution), the user will not be identified
* Apache loads servers, which might lead to the certain problems like to slow other statistics performance
* Errors in scripts may cause the whole web-server to crash

PHP as CGI

When PHP-interpreter.

Advantages

* Scripts will be executed with user privileges (www-domain owner)
* More than one PHP version can be run as CGI
* Needs less memory (RAM) than Apache module
* Errors in scripts do not cause the whole web-server to crash

Disadvantages

* Authorisation header not passed to PHP.

Advertisements
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: