Skip to content
24/7 support · 7-day money-back guarantee · Free plan, no card neededSee plans

Blog › PHP and WordPress ›

mod_php vs PHP-FPM vs LSAPI: how your host runs PHP and why it matters for WordPress

Cover image: mod_php vs PHP-FPM vs LSAPI: how your host runs PHP and why it matters for WordPress

When a serious PHP security flaw makes the news, the advice often depends on how PHP is run. In the October 2026 PHP2Shell reports, setups using PHP as an Apache module were described as the highest risk, while PHP-FPM was described as still needing urgent patching. If you have ever wondered what those terms mean, or why your host offers a choice, this guide explains them without assuming you are a system administrator. You will learn how each model works, what it means for speed and security, and how to find out which one your site uses. Understanding this does not turn you into a server engineer, but it does let you ask better questions, read news accurately and choose hosting sensibly.

Contents of the guide: mod_php vs PHP-FPM vs LSAPI: how your host runs PHP and why it matters for WordPress
The main sections of this guide.

Why the way PHP runs matters

PHP is a language, and something has to execute it every time a visitor requests a page. The web server, for example Apache, Nginx or LiteSpeed, receives the request. It then needs a way to hand PHP code to the PHP engine and send back the result. The method of handing over is called the server API, or SAPI. Different SAPIs have different trade-offs in memory use, speed, isolation between sites and ease of management.

For site owners, three consequences stand out. Performance: how efficiently requests are handled, especially under load. Security: how well one site is separated from another and from the server itself, and how exposed the setup is to certain classes of bug. Flexibility: whether you can pick different PHP versions per site, tune limits and restart things independently.

Model one: mod_php

In the Apache module model, PHP is loaded inside each Apache worker process. When a request arrives, the same process that handles HTTP also runs PHP. This design is simple and was the default for many years. Its strengths are that it is easy to set up and has low overhead for small sites.

Its weaknesses are significant for modern hosting. Every Apache worker carries the PHP engine, which consumes memory even when serving static files. All sites on the same Apache instance usually share the same PHP version and run as the same operating system user, which weakens isolation: a compromise in one site can reach files of others unless extra controls are in place. Restarting PHP means restarting Apache. And as the October 2026 reports showed, certain vulnerabilities are easier to exploit when PHP lives inside the web server process. Security researchers and the PHP project described the mod_php arrangement as the highest-risk case for the PHP2Shell flaws, because a single unauthenticated request could trigger the issue before any application code ran.

None of this means mod_php is always unsafe, only that it offers fewer protective layers and less flexibility. Most current hosts have moved away from it for shared hosting.

Model two: PHP-FPM

PHP-FPM stands for FastCGI Process Manager. Here PHP runs as separate worker processes, organized in pools. The web server, whether Apache, Nginx or another, passes PHP requests to the pool over a socket or network connection and returns the output. Static files are served by the web server without involving PHP.

Strengths: different pools can run different PHP versions, which lets a host offer a version selector per site. Each pool can run as a different system user, improving isolation between accounts. You can tune the number of workers, memory limits and timeouts per pool, and you can restart one pool without restarting the web server. The design copes better with traffic spikes because the manager can spawn and recycle workers.

Weaknesses: it is a little more complex to configure, and misconfigured pool sizes can cause slow pages or errors under load, such as running out of workers. It is not immune to vulnerabilities, as the October 2026 reports indicated. Researchers described remote code execution as confirmed against PHP-FPM through application-level code paths, and the PHP project listed it as susceptible. The lesson is that FPM improves isolation and flexibility but still needs patching and restarts.

Model three: LSAPI on LiteSpeed

LiteSpeed web servers use their own interface to run PHP, often called LSAPI, together with a process manager. From a site owner’s perspective it behaves like FPM: separate PHP processes, per-account isolation on suitable plans and a version selector. LiteSpeed is popular with hosts because of its performance and its built-in page cache, which integrates with WordPress through the LiteSpeed Cache plugin. The October 2026 coverage listed LiteSpeed among the runtimes that serve PHP requests and are therefore relevant to the flaws, which underlines that the fix is a patched PHP runtime, whatever the handler.

Strengths: strong performance, an integrated server-level cache and common availability on shared and managed WordPress plans. Weaknesses: the best caching features depend on the host’s configuration and licensing, and behavior can differ from Apache or Nginx setups in ways that matter for caching rules, for example around logged-in users and account pages.

How the models compare for WordPress

For most WordPress sites, the practical differences come down to a few points.

Speed. With proper caching, the difference is usually small for visitors, because cached pages bypass PHP. For uncached requests such as admin screens, search and checkout, FPM and LSAPI often handle concurrency better than mod_php, especially with static files offloaded.

Memory and cost. FPM and LSAPI can use memory more efficiently on busy servers because the web server does not carry PHP in every worker.

Isolation. Per-site users and pools reduce the chance that one compromised site infects others. This is a major reason to prefer FPM or LSAPI on shared hosting.

Version control. Per-site PHP versions let you upgrade one site at a time, which makes testing and staged rollouts much easier. This is directly useful when a branch reaches end of life, such as PHP 8.2 on 31 December 2026.

Security posture. None of the models removes the need to patch. The October 2026 release required fixed versions across the board. Choose a host that patches quickly and restarts workers.

How to find out which one you use

You can check without command line access. In WordPress, open Tools, Site Health, Info and look at the Server section, which shows the PHP version and often the server software. For the SAPI, create a temporary PHP file in your site root containing a call to `phpinfo()`, load it in your browser, and look for the line labeled Server API. Typical values include Apache 2.0 Handler (mod_php), FPM/FastCGI, CGI/FastCGI and LiteSpeed V8 or similar. Delete the file immediately afterwards, because it reveals sensitive configuration to anyone who finds it.

Alternatively, ask your host. A good support team answers in one message. If your plan is a managed WordPress plan, they may describe the stack on a documentation page.

Questions to ask your host

  • Which PHP SAPI do you use for my plan, and is it isolated per account?
  • How quickly do you apply PHP security releases, and do you restart workers afterwards?
  • Which PHP versions can I choose per site, and what is your policy for end-of-life branches?
  • Do you provide a web application firewall or malware scanning?
  • What are my memory limit, worker limit and execution time?
  • Is opcache enabled, and is object caching available?
  • Can I get staging copies and automatic backups?

The answers tell you more about hosting quality than any marketing page.

What this means for SEO

You might ask what a server API has to do with search rankings. The link is indirect but real. Server responsiveness under crawl and visitor load affects loading metrics and the rate at which search engines crawl your site. Isolation and patch speed affect the odds that your site is compromised, and a compromised site loses visibility through spam pages, warnings and redirects. Flexibility to upgrade PHP per site lets you stay on supported versions without breaking other sites on the same account. After any hosting change, run a site audit, check Search Console’s Crawl stats for server errors and confirm that structured data and redirects still work with the schema checker and meta checker.

Common misconceptions

More workers is always better. Not necessarily. Too many workers can exhaust memory and cause swapping, which makes everything slower. Pool sizes should match available memory and typical request cost.

FPM makes me immune. It reduces some risks and improves isolation, but it still needs patches, as the October 2026 reports showed.

The version number tells the whole story. Distributions often backport fixes without changing version numbers, so check the vendor’s advisory or ask your host.

Switching handlers is a quick win. Moving a site from one SAPI to another can change behavior, especially with caching. Test on staging.

What to do next

If you run your own server, favor FPM or LSAPI with per-site users, keep PHP updated and restart services after patches. If you use shared or managed hosting, ask the questions above, note the answers and consider moving if responses are vague. Whatever you use, keep WordPress, plugins and themes updated, take backups and monitor your site. Knowing how your stack works is the first step toward keeping it safe and fast.

Frequently asked questions

Is mod_php obsolete? It still exists and works, but it offers less isolation and flexibility than modern alternatives, and many hosts have retired it for shared plans.

Can I choose the handler myself? On many shared hosts, only the host can. On VPS and dedicated servers, you can configure it.

Does LiteSpeed make WordPress faster? Often, particularly with its cache integration, but results depend on configuration and the rest of your site.

Do I need to restart anything after PHP updates? Yes. Workers keep old code in memory until they restart. Hosts normally handle this on managed plans.

Which is best for a small WordPress site? A host that uses FPM or LSAPI with per-account isolation, current PHP versions and fast security patching.

Keep reading

Comments

Leave a comment

Check your own site

Run a free audit and see what to fix first.

Run a free audit