Advanced Configuration

Started by Sudhakar, Jun 23, 2009, 07:09 AM

previous topic - next topic
Go Down


Apache Options The Relate To PHP

CGI (mod_cgi) - This module is required for Apache to execute CGI scripts. It is strongly recommended you leave this option enabled. Disabling it will prevent serving PHP pages via mod_cgi.

CGID (mod_cgid) - Only available in Apache 2.0 and 2.2. This module is required as a replacement for mod_cgi when using a threaded MPM (discussed below.) If you select a threaded MPM, enable mod_cgid also.

Mod FCGID - Only available in Apache 2.0 and 2.2. This module allows Apache to create and manage FastCGI server processes that stay resident in memory between HTTP requests. FastCGI is like a generic version of ModPerl that will work with a variety of programming languages. Any binary capable of communicating via the FastCGI protocol can be managed by mod_fcgid. For this reason, mod_fcgid can be enabled independently of enabling FastCGI support in PHP (you might, for instance, want to server Ruby via FastCGI.) The Wikipedia entry on FastCGI provides an excellent top level overview of the concept: For more detailed information about mod_fcgid, visit their website:

MPM Prefork, Event, Worker, etc - Only available in Apache 2.0 and 2.2. Only one Multiprocessing Module (MPM) can be enabled on Apache 2.0 and 2.2. The Apache MPM's allow for fine tuning of how resources are used in serving HTTP requests. Apache 1 functions by having one process run as root. The root process forks, drops privileges, serves requests, and dies after a brief time. The number of available servers in Apache 1 is simply the number of forked children. In Apache 2, this model for serving HTTP requests is the PREFORK MPM. IE: Apache Forks before requests are made. One of the primary improvements of Apache 2 over Apache 1 is the availability of other MPMs. The Worker MPM, for instance, forks a few times (to prevent a single crash from killing the entire Apache process), then each forked process creates numerous threads to serve incoming requests. The Event MPM creates numerous threads and divides the task of serving a single HTTP request across multiple threads. The key consideration when selecting an MPM for PHP is that libphp4 and libphp5 are not thread-safe. They must be isolated in separate processes. Therefore, if you intend to serve PHP using or (DSO in the WHM interface) you must select Prefork as the Apache MPM. EasyApache 3 will automatically enable or disable Zend Thread Safe support (ZTS) in PHP based upon the selected Apache MPM. Prefork is recommended by cPanel.

Mod SuPHP - cPanel has discontinued the EasyApache 1 PHPSuexec patches and Mod SuPHP should be used in its place. It provides a very flexible way of running PHP as the owner of the VirtualHost serving the request. The operation and configuration of Mod SuPHP will be described fully below.

Important PHP Options

Most of the PHP options are self-explanatory and simply enable a particular extension shipped with PHP. This section will describe the options that have subtle interactions or have effects on how PHP is served.

CGI - This option is selected by default. Disabling it causes EasyApache to set the -disable-cgi flag. This will cause a PHP CLI binary to be installed to both /usr/bin/php and /usr/local/bin/php. When no CGI binary is available, it will be impossible to serve PHP requests using any method other than DSO.
Concurrent DSO patch - This option is frequently misunderstood. By default, it is impossible for Apache to load libphp4 and libphp5 simultaneously in memory. The two Apache modules interfere with one another and will cause segmentation faults when they are loaded at the same time. Selecting this option applies a patch to the PHP source that versions all of the objects in libphp4 and libphp5. It also creates new Apache directives so that each version of PHP can be communicated with separately (php_value becomes php4_value and php5_value, for instance.) This makes it possible to configure both PHP 4 and PHP 5 as DSO's in the WHM interface. It is not required for serving both versions of PHP via SuPHP, CGI, or FCGID. Applying this patch will make it impossible to use compiled PHP extensions other than those shipped with PHP. For example, the Zend optimizer will not function correctly. Many PECL and PEAR modules will not work correctly. Do not select this option unless you must serve both versions of PHP as DSO's and can work around the other issues it causes. This option is not available on FreeBSD 4, 5, and 6.

DiscardPath - This is a security option PHP provides that is generally not recommended. Enabling DiscardPath will prevent PHP from functioning in the CGI or FCGID configurations. DSO and SUPHP are unaffected.

FastCGI - For PHP to be served via FastCGI, Apache must be compiled with mod_fcgid support, and PHP must be compiled with FastCGI support. For a detailed explanation of how FastCGI works, see the earlier description of Mod FCGID. FastCGI support has NO EFFECT WHATSOEVER when running PHP as DSO, CGI, of SuPHP. In some cases it actually interferes with PHP functioning normally as CGI and SuPHP. It is recommended that you only enable this option if you will be running PHP via mod_fcgid and understand the performance tuning which such a setup entails

ForceCGIRedirect - This is a security option provided by PHP. In some circumstances it may interfere with running PHP in the CGI configuration.

SafePHPCGI - This option sets the -with-config-file-path and -with-config-file-scan-dir flags for PHP in an attempt to lock PHP to the system php.ini files. It prevents users from using custom php.ini files when PHP is running as a CGI. It does not prevent the use of custom php.ini files when PHP is running via mod_suphp.

Versioning - The PHP versioning option was intended to allow the same sort of functionality that the concurrent DSO patches allow. It does not work well and is not recommended by cPanel or the PHP developers.

Go Up

Quick Reply

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Note: this post will not display until it's been approved by a moderator.
Please leave this box empty:

Type the letters shown in the picture
Listen to the letters / Request another image

Type the letters shown in the picture:

shortcuts: alt+s submit/post or alt+p preview
IT Acumens Web Designing Chennai | GinGly :: Build your Personal Website | CineBuzz :: Cinema News | My Kids Diary :: Kids Memories Writing :: Book Website @ 349 Rs monthly
Copyright 2005 - 2020 :: IT Acumens :: All Rights Reserved. :: Sitemap
ITAcumens Discussion Forum with 2 lakhs post running for 15 years - Powered by IT Acumens Dedicated Server