LSAPI / LSPHP Overview
PHP Handlers are modules used by Apache to interpret and execute PHP code. WHM/cPanel offers multiple handlers, each with its own advantages in performance, compatibility, and security.
One of the most recommended options, especially when using LiteSpeed Web Server, is LSAPI (LiteSpeed Server Application Programming Interface) — a high-performance PHP handler that offers significant speed and stability benefits.
🚀 What Is LSAPI (LSPHP)?
LSAPI is LiteSpeed’s optimized PHP handler. It’s designed for speed, efficiency, and low memory consumption, making it ideal for high-traffic websites. It significantly outperforms traditional handlers like suPHP, CGI, or even DSO in most environments.
✅ Key Benefits of LSPHP (mod_lsapi):
- Better Performance: Faster than mod_php, suPHP, and CGI.
- Low CPU Usage: Handles more requests with fewer resources.
- Supports Opcode Caching (with
opcache
). - Secure: Runs PHP as the site user (suEXEC compatible).
- Stable under High Load.
- Compatible with CloudLinux PHP Selector (if used).
⚙️ How to Install mod_lsapi in WHM/cPanel
You can install LSAPI handler via command line or through WHM’s EasyApache 4 interface.
📌 Step-by-Step via SSH:
- Connect to your server via SSH.
- Run the following command:
yum install ea-apache24-mod_lsapi.x86_64
This installs the LSAPI handler for Apache 2.4.
📍 Step-by-Step via WHM:
- Go to
WHM » Home » Software » EasyApache 4
. - Under Apache Modules, search for
mod_lsapi
. - Click Install next to it.
- Provision and restart Apache.
🔧 Activate LSAPI in MultiPHP Manager
After installing mod_lsapi, assign it as the default PHP handler:
- Go to
WHM » Home » Software » MultiPHP Manager
. - Click on the PHP Handlers tab.
- Select LSAPI as the handler for each PHP version you use.
⚠️ Important Notes
- mod_lsapi is not compatible with mod_ruid2 or mod_mpm_itk. Make sure those modules are not enabled in EasyApache 4.
- Take a full backup of your server before making any changes to Apache or PHP configurations.
- CloudLinux users: If you’re using CloudLinux, a different version of LSPHP will be provided (with extra features like CRIU and connection pooling).
✅ Final Recommendations
- LSAPI is highly recommended for servers running LiteSpeed Web Server due to its performance and security advantages.
- Always test on a staging environment before applying changes to a live server.
- Monitor server load and memory usage after enabling to ensure stability.
🤔 FAQ (Optional)
Q: Is LSPHP the same as LSAPI?
A: Yes. LSPHP is the implementation of PHP using the LSAPI handler.
Q: Will LSPHP work with mod_ruid2?
A: No. You must disable mod_ruid2 before enabling mod_lsapi.
Q: Does LSPHP improve WordPress performance?
A: Absolutely. With opcode caching enabled, performance increases significantly.
The Impact of WordPress Updates on Website Speed and Performance
For detail information, please visit:
https://docs.cpanel.net/ea4/php/easyapache4-and-the-ea-php-cli-package/