📘Enable mod_lsapi on cPanel/WHM with CloudLinux (2025)

Here is the updated guide tailored for cPanel/WHM with CloudLinux, including UI options where available:

mod_lsapi is a high-performance, secure, and efficient way to serve PHP using Apache, developed by LiteSpeed Technologies. It’s ideal for high-load shared hosting environments and works perfectly with CloudLinux and PHP Selector.

🛡️ Requirement: CloudLinux OS must already be installed.


🖥️ 1. Install mod_lsapi via SSH

Login to your server via SSH as root and run:

yum install liblsapi liblsapi-devel mod_lsapi

Then set up mod_lsapi:

/usr/bin/switch_mod_lsapi --setup

🌐 2. Enable mod_lsapi

Option A: Globally (All Domains)

/usr/bin/switch_mod_lsapi --enable-global

Option B: Per Domain

Replace [domain] with the actual domain name:

/usr/bin/switch_mod_lsapi --enable-domain [domain]

🔄 3. Restart Apache

service httpd restart

🧱 4. Build Native LSPHP Binaries

To compile native PHP binaries for best performance:

switch_mod_lsapi --build-native-lsphp

✅ 5. Confirm mod_lsapi is Enabled

httpd -M | grep lsapi

Expected output:

lsapi_module (shared)

🖱️ 6. Optional: Enable via WHM UI (cPanel)

  1. Login to WHM.
  2. Navigate to: Software » MultiPHP Manager.
  3. Ensure PHP Handler is set to lsapi for each PHP version (if using EA-PHP).
  4. For alt-php versions:
    • Go to: CloudLinux Manager » PHP Selector.
    • Ensure mod_lsapi is selected under the “Handler” column.

❌ 7. To Uninstall mod_lsapi

If needed, run:

/usr/bin/switch_mod_lsapi --uninstall
Scroll to Top