LiteSpeed Web Server and OpenLiteSpeed

LiteSpeed and PHP: updating lsphp so the fixed build is the one running

LiteSpeed Web Server and OpenLiteSpeed run PHP as separate lsphp processes that talk to the server over LSAPI. To fix PHP2Shell, install the fixed lsphp package for your branch, check each virtual host points at it, then restart the PHP processes themselves, because detached lsphp keeps running when the web server restarts.

Last reviewed against php.net, the LiteSpeed and OpenLiteSpeed documentation and LiteSpeed's package repository.

How LiteSpeed runs PHP

PHP on LiteSpeed is a separate program, and it outlives restarts

LiteSpeed does not load PHP into itself. It starts an lsphp binary, PHP compiled with LiteSpeed's server API (LSAPI), and passes it PHP requests. In detached mode, which LiteSpeed Web Server uses by default, those lsphp processes keep running independently of the web server, so a web server restart leaves the old PHP in place.

Where the lsphp build comes from depends on how the server is set up. Find yours first:

3D server rack, for LiteSpeed Web Server on its own

LiteSpeed Web Server on its own

PHP comes from the lsphp packages in LiteSpeed's repository. You choose the build per handler in the WebAdmin console, under Configuration > Server > PHP.

3D cloud with a secure core, for OpenLiteSpeed

OpenLiteSpeed

The same lsphp packages and the same repository. Each build is an External App pointing at its lsphp binary, wired to the php suffix by a Script Handler.

3D hosting servers in the cloud, for LiteSpeed using cPanel's PHP builds

LiteSpeed on a cPanel server

LiteSpeed runs cPanel's own PHP builds (EasyApache 4's ea-php packages, or CloudLinux's alt-php) and follows the versions set in cPanel. You patch those packages, not lsphp.

3D cloud server with a shield, for LiteSpeed using Plesk's PHP

LiteSpeed on a Plesk server

LiteSpeed detects Plesk's PHP automatically, and LiteSpeed's documentation names Plesk as the preferred place to manage PHP. You update Plesk's PHP components.

On a panel server, update PHP through cPanel or Plesk, then come back for the detached PHP restart. The rest of this page is about lsphp from LiteSpeed's own repository.

Fixed builds

Fixed lsphp packages in LiteSpeed's repository

LiteSpeed packages lsphp as one package per branch, and its version numbers follow php.net's releases directly, so there is no backport arithmetic to do. This is what the repository listed on 27 October 2026.

Package Branch Ubuntu 24.04, Debian 12 and 13 Enterprise Linux 9
lsphp85 PHP 8.5 8.5.12-1 plus the release name 8.5.12-1.el9
lsphp84 PHP 8.4 8.4.27-1 plus the release name 8.4.27-1.el9
lsphp83 PHP 8.3 8.3.36-1 plus the release name 8.3.36-1.el9
lsphp82 PHP 8.2 8.2.35-1 plus the release name 8.2.35-1.el9

How exposed is LSAPI? php.net lists LiteSpeed among the affected setups. The PHP project's advisory for CVE-2026-109618 treats LSAPI as likely susceptible, based on analysis of the source rather than a demonstrated exploit. Treat it as vulnerable until it runs a fixed build.

Older branches. Builds for PHP 8.1 and earlier get no fix from the PHP project. Move any virtual host still on one of them to a supported branch, using the switching steps below. See also PHP end of life dates.

Step by step

Updating lsphp on LiteSpeed or OpenLiteSpeed

These steps apply to both web servers when lsphp comes from LiteSpeed's repository.

  1. 1. List the builds and their versions

    # Every lsphp build installed from LiteSpeed's repository
    ls -d /usr/local/lsws/lsphp*
    
    # The release a build reports (repeat for each one)
    /usr/local/lsws/lsphp83/bin/lsphp -v

    Each branch lives in its own directory, such as /usr/local/lsws/lsphp83/, with its binary at bin/lsphp. Run with -v, lsphp prints its version and exits.

  2. 2. Install the updates

    # Ubuntu and Debian
    sudo apt update
    sudo apt upgrade
    
    # RHEL-family servers: dnf accepts shell-style patterns
    sudo dnf upgrade 'lsphp*'
  3. 3. Check the installed package versions

    dpkg-query -W 'lsphp*'     # Ubuntu and Debian
    rpm -q lsphp83             # RHEL family, one package at a time

    Compare them with the table above. If a branch has not moved, the server may not have LiteSpeed's repository configured; LiteSpeed's documentation sets it up with its repository script before any lsphp install.

  4. 4. Restart the PHP processes, then the web server

    # Restart detached PHP, then the web server
    sudo touch /usr/local/lsws/admin/tmp/.lsphp_restart.txt
    sudo systemctl restart lsws

    These are the two commands LiteSpeed's and OpenLiteSpeed's documentation give after a PHP change. The first is the part that matters for PHP2Shell; other ways to restart detached PHP are listed below.

  5. 5. Confirm on the live site

    Use the checks further down on at least one site per lsphp build.

Per virtual host

Switching a virtual host to another lsphp version

Needed when a site runs a branch with no fix, or when you are moving between branches anyway. Install the target branch first:

# Ubuntu and Debian
sudo apt-get install lsphp84 lsphp84-common lsphp84-mysql

# RHEL family (the MySQL package is called mysqlnd here)
sudo dnf install lsphp84 lsphp84-common lsphp84-mysqlnd

OpenLiteSpeed, in the WebAdmin console

  • Whole server: under Server Configuration > External App, edit the lsphp entry and set Command to the build you want, for example lsphp84/bin/lsphp. Keep Max Connections and PHP_LSAPI_CHILDREN equal. The Script Handler maps the php suffix to that app with the type LiteSpeed SAPI.
  • One virtual host: under Virtual Hosts > your host > Script Handlers, add a handler that points at an External App for the other build, such as one named lsphp84. Settings at this level override the server's.

OpenLiteSpeed, in the configuration file

# /usr/local/lsws/conf/httpd_config.conf (excerpt; leave the other lines)
extprocessor lsphp {
  type                    lsapi
  address                 uds://tmp/lshttpd/lsphp.sock
  path                    lsphp84/bin/lsphp
}

scripthandler  {
  add                     lsapi:lsphp php
}

Change only the path line, then apply it with the restart commands from step 4. OpenLiteSpeed's documentation is explicit that the change does nothing until both PHP and the server restart.

LiteSpeed Web Server

Set handlers under Configuration > Server > PHP, where Default PHP Versions decides what serves .php files when nothing more specific applies. A virtual host with no handler of its own inherits the server's. On a standalone server, a site can also pick its version in .htaccess, following the pattern in LiteSpeed's standalone guide:

<IfModule Litespeed>
AddHandler application/x-httpd-php84 .php
</IfModule>

Changing branch can affect the application, unlike a patch release on the same branch, so test the site after the switch.

Detached mode

Restarting detached lsphp processes

Detached lsphp is started on demand when traffic reaches it, and LiteSpeed's documentation says it is not restarted when the web server restarts. Until you restart it, the processes that were running before the update keep serving with the old build.

Method Scope When the new build takes over
sudo touch /usr/local/lsws/admin/tmp/.lsphp_restart.txt The whole server Each PHP handler restarts the next time the server needs it, so busy sites move first and requests are not cut off.
touch ~/.lsphp_restart.txt One user or virtual host (the file goes in that user's home directory) On that user's next PHP request. LiteSpeed checks the file's timestamp.
sudo killall lsphp The whole server At once: every lsphp process is stopped, and new ones start on demand from the binary now on disk. Requests being handled at that moment can fail.
WebAdmin console: Actions, Restart Detached PHP Processes The whole server After you confirm with Apply Changes or Graceful Restart.
Control panel plugin: Restart Detached PHP Processes The server, or the account (cPanel users have it on the Advanced page of the LiteSpeed Web Cache Manager plugin) As the plugin applies it.

LiteSpeed's cPanel documentation also gives pkill lsphp for an immediate restart, which has the same effect as killall. For PHP2Shell, speed matters more than grace: if the restart file has not reached a quiet site within minutes, stop the processes outright.

Interim measures

Interim PHP settings for lsphp

If a fixed build cannot go on today, the PHP project's partial measures go in the php.ini of each lsphp build. The PHP project is clear that none of them is a complete mitigation.

Find the php.ini a build loads

/usr/local/lsws/lsphp83/bin/lsphp -i | grep -i 'loaded configuration file'

Add the settings

; In the php.ini this lsphp build loads. Partial measures, not a fix.
session.upload_progress.enabled = 0
; PHP 8.5 builds only:
fatal_error_backtraces = 0
  • Restart the detached processes afterwards. PHP reads php.ini when a process starts, and the advisory itself says to restart workers after these changes.
  • Session upload progress has to be switched off in configuration; ini_set() in application code cannot do it. The advisory suggests keeping it off even after patching, if nothing on the site uses it.
  • The advisory's pm.max_requests suggestion is a PHP-FPM pool setting. It does not apply to lsphp, and the advisory names no LSAPI equivalent.

The full list, including request limits in front of PHP, is on the PHP2Shell page. If no fix or interim measure can go on soon, work through whether to take the site offline.

Confirm it worked

Check through the website, not the binary

lsphp -v proves the file on disk is fixed. Only a request through LiteSpeed proves the running processes are. Put this in the site's document root, open it once, then delete it:

<?php
// lsapi-check.php: one visit, then remove it
echo 'PHP ', PHP_VERSION, ' (', PHP_SAPI, ')';
  • The server API should read litespeed. phpinfo() shows the same thing as Server API LiteSpeed.
  • The version should be 8.5.12, 8.4.27, 8.3.36 or 8.2.35 for the branch. If it is older but the package is fixed, a detached process from before the update is still answering.
  • Repeat for each virtual host that uses a different handler, and on panel servers for each PHP version the panel offers.

On a WordPress site, Site Health reports the same two values; the PHP version checking guide shows where.

CISA put both CVEs on its Known Exploited Vulnerabilities list on 26 October 2026. If a LiteSpeed site was reachable on a vulnerable build, patching it is half the job. Check it for signs of compromise.

Troubleshooting

When LiteSpeed keeps serving the old PHP

lsphp -v shows the fixed release, but the site still reports the old one

Detached lsphp processes started before the update are still serving. Touch the server-wide restart file, or run killall lsphp if you need it immediately, then load the page again.

One virtual host stays on an old PHP branch

A handler defined at virtual host level overrides the server's, and an AddHandler or ForceType line in .htaccess can override both. Check the host's Script Handlers and its .htaccess files.

A newly installed lsphp version does not appear

LiteSpeed's standalone guide says to restart LiteSpeed Web Server after installing a new lsphp package so that it detects the version. On OpenLiteSpeed, add it as an External App first.

On cPanel, MultiPHP Manager will not let you change the handler

cPanel documents that, with LiteSpeed present, WHM locks the MultiPHP handler settings and uses lsphp as the handler. The PHP builds themselves are still cPanel's ea-php packages, so update those through WHM.

PHP errors out after you edited the OpenLiteSpeed External App

The Command must be the path of an installed build, for example lsphp84/bin/lsphp. OpenLiteSpeed's documentation also asks for Max Connections and PHP_LSAPI_CHILDREN to be set to the same value.

A setting in php.ini makes no difference

Each lsphp build reads its own php.ini, so the file you edited may belong to another branch. Find the right one with lsphp -i, then restart the detached processes for that build.

Quick answers

LiteSpeed and PHP2Shell: questions, answered

What is lsphp?

lsphp is PHP built with LiteSpeed's server API, LSAPI, which is part of PHP's own source code. LiteSpeed Web Server and OpenLiteSpeed start lsphp as a separate process and send it PHP requests. Pages served this way report their server API as litespeed. LiteSpeed's repository packages one build per branch, such as lsphp83 for PHP 8.3.

Is LiteSpeed affected by PHP2Shell?

Yes. php.net lists LiteSpeed among the affected setups, and the PHP project's advisory treats LSAPI as likely susceptible based on its analysis of the source. No LiteSpeed-specific fix exists: you need an lsphp build of 8.5.12, 8.4.27, 8.3.36 or 8.2.35, or your control panel's fixed PHP package.

The PHP2Shell advisory

Does restarting LiteSpeed Web Server load the new PHP?

Not on its own. LiteSpeed's documentation says PHP in detached mode keeps running when the web server restarts, and since LiteSpeed Web Server 5.3 PHP runs detached by default on cPanel. Restart the PHP processes themselves with the restart file, the WebAdmin action or killall lsphp.

Is OpenLiteSpeed handled differently?

The PHP side is the same: the same lsphp packages from the same repository, the same binary paths and the same restart file. The difference is configuration. OpenLiteSpeed sets the build through an External App and Script Handler in its WebAdmin console or httpd_config.conf; LiteSpeed Web Server has a PHP section with default versions.

My host runs LiteSpeed with cPanel or Plesk. Where is PHP updated?

In the control panel's PHP packages: cPanel's ea-php (or CloudLinux's alt-php) builds, or Plesk's PHP components. LiteSpeed uses those builds rather than its own lsphp packages. After the panel's update, restart detached PHP so the new build is the one serving.

Updating PHP on cPanel

Which .htaccess line selects a PHP version on LiteSpeed?

On a standalone LiteSpeed Web Server, LiteSpeed's guide uses AddHandler application/x-httpd-phpXX .php inside an IfModule Litespeed block, with XX replaced by the version installed, so 84 for PHP 8.4. Choosing a version this way does not patch it: the build behind the handler still has to be a fixed release.

Other servers: Apache, PHP-FPM and nginx, Docker, or the full list of update routes.

3D rocket illustration above the call to find every exposed PHP server

Know your exposure

Find every PHP server you run

Patching the server you know about is the easy part. A vulnerability scan finds the forgotten staging site, the old microsite and the appliance with PHP inside, then tells you which ones are still exposed.