ispmanager 6 lite, pro, host

/
/
/
Discontinuing the "PHP as an Apache module" mode on CloudLinux

Discontinuing the "PHP as an Apache module" mode on CloudLinux

In the “Apache module” PHP mode, scripts for all websites are executed on behalf of the web server user rather than the website owner. On CloudLinux, this compromises user isolation; therefore, starting with version 6.157, ispmanager is phasing out the “Apache module” mode on CloudLinux.

For new installations of the control panel on CloudLinux, the “Apache module” mode is not available. When an operating system is converted to CloudLinux (on ispmanager version 6.157 or later), websites are automatically switched to other PHP modes.

If the control panel was installed on CloudLinux previously, the mode remains after an update. Disable it manually by following the instructions below.

Requirements for discontinuing the “Apache module” mode

ispmanager plan: lite, pro, or host

ispmanager version: 6.157 or later

OS: CloudLinux

Software configuration: PHP LSAPI or PHP-FPM FastCGI mode must be installed

Preparing to discontinue the “Apache module” mode

Create a data backup.

Once the “Apache module” mode is discontinued, it cannot be restored via the ispmanager interface.

Check websites that enable PHP using AddType or SetHandler directives within their .htaccess files. After the “Apache module” mode is discontinued, these websites will no longer execute PHP.

Discontinuing the “Apache module” mode

  1. Connect to your ispmanager server via SSH.
  2. Execute the following command with root permissions:

    /usr/local/mgr5/sbin/mgrctl -m ispmgr webreconfigure.modphp

The terminal will display an OK response. The websites will be switched to other PHP modes in the background. Once completed, a notification will appear in the control panel’s notification center: “The Apache module has been disabled: the websites have been switched to other PHP modes, and the PHP module has been removed.”

If the command returns an error
  • “The use of Apache module is getting discontinued” — the transition has already started. Please wait for the completion notification.
  • “The 'Apache module' on this server executes PHP on behalf of site owners; there is no need to discontinue its use” — indicates that the server is using Apache ITK or is not running on CloudLinux. In this case, removing the module is unnecessary.

Changes after discontinuing the “Apache module” mode

  • Websites previously running in the “Apache module” mode will be switched to LSAPI. If LSAPI is unavailable for a site's specific PHP version, the site will be switched to either CGI or PHP-FPM.
  • The permission to use the “Apache module” mode is revoked for users and user templates. The default PHP mode is updated to an available alternative.
  • The PHP module is removed from the server, and both the Apache web server and the control panel are restarted.
  • The PHP module package will no longer appear in the Web-server (WWW) form in the Software configuration section.

Retrying the discontinuation of the “Apache module” mode

If the transition does not complete successfully, an error labeled “PHP module for CloudLinux” will appear under Monitoring → Notifications. The error details will specify the cause and list the websites for which no suitable PHP mode could be found. Most commonly, this occurs because the owner of these websites lacks permission for any available PHP mode.

The control panel will not automatically re-attempt the PHP mode switch. As long as the removal process remains incomplete, the PHP module will stay on the server.

  1. Log in to ispmanager with an administrator-level account or above.
  2. Navigate to the Users section.
  3. Select the website owner and click Edit icon Edit.
  4. In the Access section, check the box next to one of the following PHP modes:
  5. Save the changes.
  6. Connect to the server via SSH and execute the command again.

Once the transition is successful, the error will disappear from the Monitoring → Notifications section.

Technical details of discontinuing the “Apache module” mode

The following packages are removed from the server:

  • ispmanager-pkg-php — PHP for the Apache web server in the “Apache module” mode
  • isp-httpd-mod_php — the module through which Apache executes PHP scripts
  • php — for CloudLinux 7 and 8 (provided the package is not required by other applications)

The command does not install any new packages; the server must already have either ispmanager-pkg-lsapi-cl (mod_lsapi module) or ispmanager-pkg-phpfpm.

If phpMyAdmin, phpPgAdmin, or AfterLogic are installed on the server, they will operate via PHP-FPM following this change. The default pool, /etc/php-fpm.d/www.conf, is disabled in the process, as it runs under the web server user account. If this is the only PHP-FPM pool, the file remains unchanged. If the administrator has manually modified the pool, the control panel saves a copy of it at /etc/php-fpm.d/www.conf.ispmgr-saved.