Help

PHP Operation Modes

In the ISPmanager control panel, you have the option to choose from several PHP operation modes:

  • Apache Module (mod_php)
  • CGI
  • FastCGI
  • PHP-FPM (Nginx + PHP-FPM)

Apache Module (mod_php)

When using PHP in mod_php mode, PHP code processing is performed directly by the Apache web server through its PHP module, rather than through third-party modules or interpreters.

Features of mod_php Mode

  • Considered one of the fastest modes in the Apache environment (but slower than Nginx + PHP-FPM).
  • Allows PHP settings to be edited via .htaccess files.
  • Global PHP settings are configured for all user domains and can only be changed by the administrator.
  • Allows using only one PHP version for all users.
  • All processes run under the apache user, making it challenging to identify the specific user who initiated the process.
  • May be slower when processing static files.

How to Enable mod_php Mode

  1. In the "Settings" section, select "Software Configuration" and click "Edit".
  2. Choose "Apache-MPM-ITK" or "Apache MPM-Prefork". Ensure that the "PHP Module" option is enabled.
  3. Grant access to the user. In the "Users" section, select the relevant user and click "Edit".
  4. On the "Access" tab, check "Can use PHP as an apache module".
  5. When creating a new site or editing an existing one, select this mode in the "Additional Features" under "PHP Operation Mode".

CGI

In this mode, the web server runs php-cgi for each script and then processes the execution result.

Features of CGI Mode

  • CGI is the least performant mode and is considered outdated.
  • PHP settings can be configured individually for each user, and users can change them as they wish.
  • Each domain can choose its own PHP version.

How to Enable CGI Mode

  1. Go to "Settings" > "Software Configuration" and select "Web server", then click "Edit".
  2. Choose "Apache-MPM-ITK" or "Apache MPM-Prefork".
  3. Grant access to the user. In the "Users" section, select the relevant user and click "Edit".
  4. On the "Access" tab, check "Can use PHP in CGI mode".
  5. When creating a new site or editing an existing one, select this mode in the "Additional Features" under "PHP Operation Mode".

FastCGI

FastCGI is an advancement of CGI technology and is a more performant and modern version. Unlike CGI, in this mode, a separate process is not started for each script, reducing resource consumption.

Features of FastCGI Mode

  • This mode operates slightly slower than the Apache module and PHP-FPM but faster than CGI.
  • PHP settings can be configured individually for each user, and users can change them on their own.
  • Each domain can select the required PHP version.
  • Each request is executed on behalf of a specific user, and errors in scripts will not affect the operation of other users' domains.
  • There is also an option to edit parameters through the .htaccess file.

How to Enable FastCGI Mode

Use the instructions for setting up PHP in FastCGI mode.

PHP-FPM (Nginx + PHP-FPM)

This PHP operation mode involves processing content with the Nginx web server module instead of Apache.

Features of PHP-FPM Mode

  • This mode is significantly more performant than other operation modes.
  • PHP settings can be configured individually for each user , and users can change them on their own.
  • Each domain can select the required PHP version.
  • Processing of static files is very fast.
  • Does not support the .htaccess file. Configuration rules should be specified in Nginx configuration files.

How to Enable PHP-FPM Mode

Follow the instructions for setting up PHP in Nginx + PHP-FPM mode.

Have more questions about Hosting?