Tag: php8

Tutorials, WordPress

Patching abandoned WordPress themes for PHP 8: the widget constructor fix

Laptop displaying a code editor with class hierarchy panel and method documentation tooltip — typical view when reading inherited legacy code (photo: DKomov / Pexels)

You upgrade an OpenLiteSpeed box from PHP 7.4 to PHP 8.2, the four sites running mainstream themes come up clean, and the fifth — running a 2013-era premium theme that hasn’t been touched by its author since 2018 — throws …

Sysadmin, Tutorials

Per-vhost PHP versions in OpenLiteSpeed: keep one site on 7.4 while everything else moves to 8.2

Close-up of PHP source code displaying version_compare("5.2", PHP_VERSION) check and require_once includes — typical PHP version handling code (photo: Pixabay / Pexels)

Modernizing the PHP runtime on a multi-tenant LSWS box is rarely an “all sites at once” affair. Some sites are on a custom theme that uses PHP 4-style class constructors. Some have a plugin still calling create_function(), removed in …

Blog

Using multiple PHP versions in OpenLiteSpeed

OpenLiteSpeed (OLS) includes a nice “Compile PHP” option under Tools. We can use it to compile different versions of PHP. So, I compiled 7.4.24 and 8.0.11 and the binaries were saved in the folders /usr/local/lsws/lsphp7 & /usr/local/lsws/lsphp8 respectively.

Then I …