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 automate windows 11 clipboard with ai 2026 guide 20260910

How to Automate Windows 11 Clipboard with AI in 2026: Full Guide

Learn how to automate Windows 11 clipboard with AI in 2026. Step-by-step Copilot tricks, Power Automate flows, and top AI clipboard managers explained.
blog meta muse ai agent iphone fix 20260909

Meta AI Agent Not Working on iPhone? Fix Muse Issues Fast

Muse, Meta's personal AI agent, failing to launch, sync, or respond on your iPhone? Here's how to fix the most common issues reported by Apple users.
blog iphone mirroring not working macos 27 golden gate fix 20260909

How to Fix iPhone Mirroring Not Working on macOS 27 Golden Gate

iPhone Mirroring not working on macOS 27 Golden Gate? Follow these proven fixes to restore Continuity, connectivity, and seamless iPhone-to-Mac mirroring today.
blog kier group microsoft copilot construction safety 20260908

Kier Group Taps Microsoft Copilot for Safer Construction Sites

Kier Group's Louisa Finlay is deploying Microsoft Copilot to improve safety standards and workforce productivity across UK construction operations.
blog ios 27 live translate iphone guide 20260908

How to Use iOS 27 Live Translate on iPhone for Real-Time Chats

Learn how to use iOS 27 Live Translate on iPhone for real-time chats, calls, and messages. Complete 2026 setup guide, tips, and troubleshooting.
blog samsung one ui 8 tips hidden features 20260906

15 Hidden Samsung One UI 8 Tips Every Galaxy User Should Try in 2026

Discover 15 powerful Samsung One UI 8 tips to unlock hidden features, boost productivity, and customize your Galaxy device like a pro in 2026.
blog openai agent message board apple fix 20260905

OpenAI Agent Message Board Discovery: Fix Apple Device Issues

Users report an unfamiliar OpenAI agent message board appearing on Apple devices. Learn what causes it and how to troubleshoot it safely on macOS and iOS.
blog windows 11 25h2 file sharing not working fixes 2026 20260905

Windows 11 25H2 File Sharing Not Working? 10 Fixes for 2026

Windows 11 file sharing not working after 25H2? Discover 10 proven fixes for SMB errors, access denied issues, and network discovery problems in 2026.
blog apple intelligence slow response fix 20260904

Apple Intelligence Slow Response Times: How to Fix Lag Issues

Apple Intelligence responses feeling sluggish on your iPhone or Mac? Here's a complete troubleshooting guide to fix slow AI performance and lag issues fast.
blog bitwarden app review 2026 best android password manager 20260904

Bitwarden App Review 2026: Best Password Manager for Android 16?

Our Bitwarden app review 2026 tests autofill, passkeys, and security on Android 16 to see if it's still the best free password manager available.

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.