Updating PHP
VPS > Web Server
2025-07-21T23:22:47-04:00 Isaac Greene
Updating PHP requires certain steps unique to LiteSpeed server.
apt updatethenapt-get install build-essential pkg-config openssl libssl-dev bison autoconf automake libtool re2c flex libxml2-dev libssl-dev libbz2-dev libcurl4-openssl-dev libdb++-dev libjpeg-dev libpng-dev libxpm-dev libfreetype-dev libgmp3-dev libc-client2007e-dev libldap2-dev libmcrypt-dev libmhash-dev freetds-dev zlib1g-dev libmysqlclient-dev libncurses-dev libpcre3-dev unixodbc-dev libsqlite3-dev libaspell-dev libreadline-dev librecode-dev libsnmp-dev libtidy-dev libxslt1-dev libkrb5-dev libc6-dev libonig-dev libzip-devcd /tmpwget https://www.php.net/distributions/php-8.4.10.tar.gz, replace 8.4.10 with the current versiontar -xf php-8.4.10.tar.gzcd php-8.4.10./configure --prefix=/usr/local/lsws/lsphp84 --enable-litespeed --with-mysqli --with-zlib --enable-gd --enable-shmop --enable-sockets --enable-sysvsem --enable-sysvshm --enable-mbstring --with-iconv --with-pdo-mysql --enable-ftp --with-zip --with-curl --enable-soap --enable-xml --with-openssl --enable-bcmathreplace the lsphp84 in the prefix with the current versionmakethenmake installwhich can both take a while- Log into the OpenLiteSpeed web admin portal
- Go to Server Configuration > External App > edit lsphp > change "command" to
lsphp84/bin/lsphp(again replace lsphp84 with current version) - Restart server
Fin.