How to Downgrade to PHP 7.4 on an OpenLiteSpeed WordPress VPS (Ubuntu 24.04 “noble”)

GeneralHow to Downgrade to PHP 7.4 on an OpenLiteSpeed WordPress VPS (Ubuntu...

Running legacy code on the latest Ubuntu can be tricky because Canonical and LiteSpeed no longer ship PHP 7.4 for 24.04. This guide shows three workable methods—with screenshots, commands, and fall-back tips—so you can publish your WordPress (or any PHP app) today and still roll forward later.

Contents

  1. Why PHP 7.4 isn’t in the repo any more
  2. Quick comparison of the three downgrade paths
  3. Method A (recommended) – Point OpenLiteSpeed at an external php-fpm 7.4 pool
  4. Method B – Compile lsphp 7.4 from source (keeps LSAPI speed)
  5. Method C – Redeploy on Ubuntu 22.04/Debian 12 where lsphp74 is still packaged
  6. FAQ & troubleshooting matrix
php downgrade 2 74 openlitespeed

1. Why can’t apt install lsphp74 find anything?

  • LiteSpeed’s official repo starts at PHP 8.1 for Ubuntu 24.04.
    The older lsphp74 series is built only for 18.04, 20.04 and 22.04. docs.vultr.com
  • Ubuntu’s own archives removed PHP 7.x in favour of 8.3.
  • PHP 7.4 reached end-of-life on 28 Nov 2022 (no security patches).

So if your application truly requires 7.4 you need an alternate package source or you need to build it yourself.


2. Three downgrade paths at a glance

PathHow long?Maintained byProsCons
A. Use php-fpm 7.4 from Ondřej Surý’s PPA5 minCommunity PPAPackage-managed, easy to swap to PHP 8 laterSlightly slower than LSAPI; PPA is “best-effort”
B. Compile lsphp 7.4 from source15 minYouFull LSAPI speed, no extra repoManual updates; need build tools
C. Re-deploy on 22.04/LS repo10 min + migrateLiteSpeedClean, binary packagesServer rebuild; still EOL PHP

The rest of this article walks through Method A in depth, with call-outs for B & C where they differ.


3. Method A — php-fpm 7.4 + FastCGI handler

Step 1 – Install PHP 7.4-FPM and common extensions

sudo apt update
sudo apt install -y software-properties-common ca-certificates curl
sudo add-apt-repository ppa:ondrej/php # press <Enter>
sudo apt update
sudo apt install -y php7.4-fpm \
php7.4-{mysql,xml,gd,zip,curl,intl,mbstring,imagick,opcache}

The Ondřej Surý PPA still publishes 7.4 packages for noble. launchpad.net

php7.4-fpm starts automatically and listens on
/run/php/php7.4-fpm.sock.


Step 2 – Create a FastCGI External App in OpenLiteSpeed

FieldValue
TypeFastCGI App
Namephp74fpm
Addressuds://run/php/php7.4-fpm.sock
Max Connections100
Start By ServerNo
Command(leave blank)
Ext Path InfoYes
(toggle “Show All” in the form to reveal this field)

Save ➜ Graceful Restart.

Why “Start By Server = No”?
php-fpm is already running as a service; OLS should act only as a client.


Alternate GUI-hidden field method

If Ext Path Info isn’t visible:

  1. SSH in and open /usr/local/lsws/conf/httpd_config.conf.
  2. Find the extprocessor php74fpm block and add: apacheCopyEditextPathInfo 1
  3. sudo /usr/local/lsws/bin/lswsctrl restart.

Step 3 – Switch the global Script Handler

Server Configuration ▸ Script Handler → edit the php row:

FieldNew value
Handler TypeFastCGI
Handler Namephp74fpm

Save ➜ Restart.

(Leave the vHost-level Script Handler blank so it inherits this one.)


Step 4 – Verify

echo '<?php phpinfo(); ?>' | sudo tee /var/www/www.hawkdive.com/info.php
  • Visit http://your-site/info.php → header shows PHP 7.4.33.
  • WordPress front-end & /wp-admin/ should load without 403s.
  • Tail /usr/local/lsws/logs/error.log to be sure the PATH_INFO errors are gone.

Step 5 – (Optionally) switch CLI to PHP 7.4

sudo apt install -y php7.4-cli
sudo update-alternatives --set php /usr/bin/php7.4

4. Method B — Compile lsphp 7.4 yourself (LSAPI performance)

apt install -y build-essential libxml2-dev libcurl4-openssl-dev \
libjpeg-dev libpng-dev libonig-dev libzip-dev
wget https://www.php.net/distributions/php-7.4.33.tar.gz
tar xzf php-7.4.33.tar.gz && cd php-7.4.33
./configure --with-litespeed --prefix=/usr/local/lsws/lsphp74 \
--with-mysqli --with-openssl --enable-mbstring --enable-gd \
--with-zlib --with-curl --enable-intl --with-zip
make -j"$(nproc)" && make install

Now create an LSAPI External App:

| Address | uds://tmp/lshttpd/lsphp74.sock |
| Command | /usr/local/lsws/lsphp74/bin/lsphp |
| Start By Server | Yes (Through CGI Daemon) |
| Ext Path Info | Yes |

Switch the Script Handler to this app and restart.


web programmer

5. Method C — Spin up a 22.04 VPS

  1. Deploy Ubuntu 22.04 + OpenLiteSpeed image.
  2. sudo wget -O - https://repo.litespeed.sh \| sudo bash
  3. sudo apt install lsphp74 lsphp74-{curl,mysql,xml,...}
  4. Switch Script Handler to lsphp74 (already created by the helper).
  5. rsync your /var/www and database over.

6. FAQ & Troubleshooting Matrix

ErrorCauseFix
E: Unable to locate package lsphp74LiteSpeed repo for 24.04 has no 7.4 buildsUse Method A or C
403 Forbidden + “static file with PATH_INFO”Ext Path Info offEnable it (GUI or config line)
503 Service Unavailable + connect() failed: Permission deniedOLS user cannot write to FPM socketlisten.owner/group = www-data and listen.mode = 0660 (or 0666)
No input file specifiedWrong DocumentRoot or chrootFix path / disable chroot

Final thoughts

OpenLiteSpeed makes it painless to swap interpreters, so you can keep a legacy project alive while planning an upgrade path. Remember that PHP 7.4 receives zero security fixes—lock down /wp-admin/, use strong passwords, and schedule that code refactor sooner rather than later.

Happy hosting!

Nasir Sohail
Nasir Sohail
Nasir is a software engineer with an M.Sc. degree in software engineering and various certifications related to computer hardware and networking, such as MCSE, CCNA, RHCE. He has more than 15 years of mixed industry experience mostly related to IT Support, Web development and Server administration. He also offers his freelancing gig for IT support and consultancy and has more than 400 combined five-star reviews across platforms like Fiverr, Google, TrustPilot, etc.
Watch & Subscribe Our YouTube Channel
YouTube Subscribe Button

Latest From Hawkdive

You May like these Related Articles

blog apple id trust sign in sync fix 20260808

Apple Devices Losing Trust: Fix Widespread Sign-In & Sync Failures

Fix persistent Apple ID trust, sign-in loops, and iCloud sync failures across iPhone, iPad, and Mac with this step-by-step troubleshooting guide.
blog chatgpt gpt 5 6 sol luna apple devices fix 20260807

ChatGPT GPT-5.6 Sol and Luna Access Issues on Apple Devices: Fix Guide

ChatGPT GPT-5.6 Sol slow or Luna unavailable on iPhone, iPad or Mac? Here's how to fix access, login and model selection problems on Apple devices.
blog apple devices google services not working fix 20260806

Apple Devices Failing to Load Google Services? Fix Guide

Fix Google service disruptions on iPhone, iPad and Mac. Troubleshoot sign-in errors, sync failures and app crashes with this Hawkdive guide.
blog genai coding assistants macos troubleshooting 20260805

GenAI Coding Assistants Failing on macOS: Fixes That Work

Fix unreliable GenAI coding assistants on macOS with practical troubleshooting steps, Xcode integration tips, and proven workflow adjustments for Apple developers.
blog run large qwen llm mac iphone ram fix 20260804

Running Large Qwen LLMs on Mac and iPhone: Fix RAM Issues

Struggling to run 80B Qwen on Mac or 35B on iPhone with low RAM? Hawkdive's guide fixes memory errors, crashes, and slow inference on Apple Silicon.
blog language model 6502 processor troubleshooting 20260803

Apple Community Fix: Language Model on 6502 Processor Issues

Troubleshoot running an autoregressive language model on the 6502 processor with practical fixes, memory workarounds, and Apple community-tested solutions.
blog apple intelligence financial advice not working fix 20260802

Apple Intelligence Financial Advice Not Working? How to Fix It

Apple Intelligence giving vague or inaccurate financial answers on iPhone, iPad, or Mac? Here's how to fix prompt handling, Siri handoff, and privacy blocks.
blog chrome crashing mac june update fix 20260801

Chrome Crashing on Mac After June Update? Here’s How to Fix It

Chrome crashing or freezing on your Mac after recent security updates? Here's a complete troubleshooting guide to restore stable browsing on macOS.
blog deepseek v4 flash update apple fix 20260731

DeepSeek-V4-Flash Update Issues on Apple Devices: Fix Guide

Struggling with the DeepSeek-V4-Flash update on your Mac, iPhone or iPad? Follow this troubleshooting guide to fix crashes, install errors and slowdowns.
blog apple intelligence not publishing research fix 20260730

Apple Intelligence Not Publishing Research: Fixes & Workarounds

Apple Intelligence features failing to sync, publish, or share research summaries? Here's a complete troubleshooting guide with confirmed fixes for 2026.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.