Ispmanager 6 lite, pro, host

PHP modes

In ispmanager you can enable PHP scripts for a website. To do so, enable the PHP option and enter its parameters when creating or editing a website. Learn more under Add a website.

Supported PHP modes:

  • for the Apache web server:
    • Apache module;
    • CGI;
    • FastCGI (Apache);
  • for the Nginx web server:
    • FastCGI (Nginx + PHP-FPM);
  • for the OpenLiteSpeed web server:
    • LSAPI.

For more information about PHP settings in different modes, please refer to the article PHP settings.

Apache module

Details:

  • dynamic content is handled by the PHP module of the Apache web server;
  • PHP settings can be specified individually for each website if Nginx is enabled in the panel. To change the PHP version for the site: navigate to the Sites sectionselect a site → click select the PHP version in the Handler (PHP) block;
  • the fastest Apache mode. The only mode faster than the Apache module is "FastCGI (Nginx + PHP-FPM)";
  • each installed PHP version runs as a separate Apache service on its own dedicated port if there are websites that are using this handler.

Perform the following operations to activate the module:

  1. Install Apache-MPM-ITK or Apache MPM-Prefork, the PHP module. Learn more under Set up a web-server .
  2. Go to Accounts → Users → Edit enable the option PHP as Apache module.
  3. Select the mode when creating or editing the website. Learn more under Add a website.

The Apache configuration file of the website:

Apache configuration file

<FilesMatch "\.ph(p[3-5]?|tml)$">
    SetHandler application/x-httpd-php
</FilesMatch>
<FilesMatch "\.phps$">
    SetHandler application/x-httpd-php-source
</FilesMatch>
<IfModule php5_module>
    php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -f <administrator email>"
    php_admin_value upload_tmp_dir "/var/www/www-root/data/mod-tmp"
    php_admin_value session.save_path "/var/www/www-root/data/mod-tmp"
    php_admin_value open_basedir "/var/www/www-root/data:."
</IfModule>
<IfModule php7_module>
    php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -f <administrator email>"
    php_admin_value upload_tmp_dir "/var/www/www-root/data/mod-tmp"
    php_admin_value session.save_path "/var/www/www-root/data/mod-tmp"
    php_admin_value open_basedir "/var/www/www-root/data:."
</IfModule>

<IfModule php5_module>
    php_admin_flag engine on
</IfModule>
<IfModule php7_module>
    php_admin_flag engine on
</IfModule>

CGI

Details:

  • dynamic content is handled by Apache as CGI;
  • PHP settings are specified individually for each website. To change the PHP version for the site: navigate to the Sites sectionselect a site → click select the PHP version in the Handler (PHP) block;
  • the slowest mode.

Perform the following operations to activate the module:

  1. Install Apache-MPM-ITK or Apache MPM-Prefork, the PHP module. Learn more under Web-server configuration.
  2. Go to Accounts → Users → Edit enable the option PHP as CGI.
  3. Select the mode when creating or editing the website. Learn more under Add a website.

The Apache configuration file of the site:

Apache configuration file

<FilesMatch "\.ph(p[3-5]?|tml)$">
    SetHandler application/x-httpd-php5
</FilesMatch>
ScriptAlias /php-bin/ /var/www/php-bin-isp-php52/<Site owner>/
AddHandler application/x-httpd-php5 .php .php3 .php4 .php5 .phtml
Action application/x-httpd-php5 /php-bin/php

FastCGI (Apache)

Details:

  • dynamic content is handled by Apache as FastCGI;
  • PHP settings are specified individually for each website. To change the PHP version for the site: navigate to the Sites sectionselect a site → click   select the PHP version in the Handler (PHP) block;
  • a faster mode that "CGI', but slower than  "Apache module" and"FastCGI (Nginx + PHP-FPM)". 

Perform the following operations to activate the module:

  1. Install Apache MPM-Prefork and the PHP module. Learn more under Set up a web-server .
  2. Go to Accounts → Users → Edit enable the option PHP as  FastCGI (Apache).
  3. Select the mode when creating or editing the website. Learn more under Add a website.

The Apache configuration file of the website:

Apache configuration file

<FilesMatch "\.ph(p[3-5]?|tml)$">
    SetHandler fcgid-script
    FCGIWrapper /var/www/php-bin/<WWW-domain owner>/php
</FilesMatch>

Options +ExecCGI

FastCGI (Nginx + PHP-FPM)

Details:

  • dynamic content is handled by PHP-FPM;
  • PHP settings are specified individually for each website. To change the PHP version for the site: navigate to the Sites sectionselect a site → click select the PHP version in the Handler (PHP) block;
  • PHP-FPM doesn't support .htaccess rules;
  • the fastest mode. 

Perform the following operations to use the module:

  1. Install Nginx, PHP-FPM FastCGI. Learn more under Install a web-server.
  2. Go to Accounts → Users → Edit enable the option PHP as FastCGI (Nginx + PHP-FPM).
  3. Select the mode when creating or editing the website. Learn more under Add a website.
  4. To change PHP version:
    • under user’s account, enter WWW → PHP;
    • under admin’s account, go to user editing form.

The Nginx configuration file of the website:

Nginx configuration file

location @php {
    fastcgi_index index.php;
    fastcgi_param PHP_ADMIN_VALUE "sendmail_path = /usr/sbin/sendmail -t -i -f <administrator email>";
    fastcgi_pass unix:/var/www/php-fpm/www-root.sock;
    fastcgi_split_path_info ^((?U).+\.ph(?:p\d*|tml))(/?.+)$;
    try_files $uri =404;
    include fastcgi_params;

LSAPI

Details:

  • dynamic content is handled by the LSAPI module of the OpenLiteSpeed web-server;
  • PHP settings are specified individually for each website. To change the PHP version for the site: navigate to the Sites sectionselect a site → click select the PHP version in the Handler (PHP) block;
  • for each site that is using this mode, any PHP version can be selected from the list of installed alternative versions. The native PHP version is used for the module itself;

Perform the following operations to activate the module:

  1. Install the OpenLiteSpeed server. Learn more under Install a web-server.
  2. Go to Users → Edit and enable the option Can use PHP as LSAPI mode.
  3. Select the mode when creating or editing the website. Learn more under Add a website.