Every PHP page your site serves is passed from the web server to a PHP process. On MdmHost, LiteSpeed Web Server uses its own handler, LSAPI (LiteSpeed Server Application Programming Interface), to do that. Understanding it helps when you read error messages or tune performance.
Before you start
Nothing to install: LSAPI is the default PHP handler on MdmHost cPanel servers and works with the PHP version you choose in Select PHP Version.
How LSAPI works
- LiteSpeed keeps a small pool of PHP processes running per account and reuses them, instead of starting PHP for every request as CGI does.
- Processes run as your cPanel user, inside your CloudLinux LVE and CageFS, so they are isolated from other accounts.
- Idle processes stop after a short time, so an inactive site uses almost no memory.
- LSAPI talks to LiteSpeed over a lightweight protocol designed for it, with less overhead than FastCGI.
LSAPI compared with other handlers
| Handler | Speed | Notes |
|---|---|---|
| CGI / suPHP | Slow | Starts PHP for each request; no opcode cache benefit. |
| PHP-FPM | Fast | Common with Nginx and Apache event (see PHP-FPM on cPanel). |
| LSAPI | Fast | Native to LiteSpeed; supports OPcache, .htaccess php_value, per-user isolation. |
OPcache
LSAPI keeps PHP processes alive, so OPcache (compiled PHP code stored in memory) works well. Make sure the opcache extension is ticked in Select PHP Version; it is on by default for most versions.
How limits apply
Each running LSAPI process counts toward your CloudLinux limits:
- Entry processes: each request being processed by PHP.
- Physical memory: the memory of all your PHP processes together.
- NPROC: total processes, including PHP.
This is why caching matters: a page served from LSCache does not start a PHP process at all. More in reading Resource Usage.
PHP settings with LSAPI
- Use the Options tab in Select PHP Version (see PHP options).
php_valuelines in.htaccessalso work with LSAPI, but avoid setting the same value in two places..user.inifiles are read too, with a short cache delay.
Troubleshooting
503 Service Unavailable
PHP processes could not start, often because the account hit its memory or process limit, or a PHP fatal error at startup. Check Resource Usage and cPanel → Metrics → Errors.
"Premature end of script headers" or "lsapi: Child process died"
PHP crashed during the request. Common causes are a broken extension (disable recently added ones) or memory exhaustion. Switch PHP version briefly to test.
Changes to PHP options are slow to apply
Running processes keep the old settings until they are recycled, usually within a minute.
Tip: If a site is slow but Resource Usage is fine, the bottleneck is usually database queries or external API calls, not the PHP handler. Profile the application before changing PHP settings.
Frequently asked questions
Can I switch to PHP-FPM?
On LiteSpeed servers, LSAPI is the supported and fastest option, so there is no need. PHP-FPM settings in cPanel apply only to Apache-based setups.
Does LSAPI work with all PHP versions?
Yes. All versions in the CloudLinux PHP Selector run through LSAPI.
