Install OpenLiteSpeed with PHP 8.1

These are the steps to install OpenLiteSpeed with lsphp81 on CentOS replacements like AlmaLinux 8 or RockyLinux 8.

First add LiteSpeed repositories for AlmaLinux 8 & CentOS 8 with following command:

rpm -Uvh http://rpms.litespeedtech.com/centos/litespeed-repo-1.1-1.el8.noarch.rpm

After you have installed the rpm package you will get /etc/yum.repos.d/litespeed.repo repo file which you will need to edit in order to avoid getting the following error when installing or updating packages with yum/dnf.

Invalid configuration value: failovermethod=priority in /etc/yum.repos.d/litespeed.repo; Configuration: OptionBinding with id "failovermethod" does not exist

This will happen because the ‘failovermethod’ option is not supported by dnf which comes with RHEL 8.

Comment out that line from /etc/yum.repos.d/litespeed.repo with following command:

sed -i 's/failovermethod=priority/#failovermethod=priority/' /etc/yum.repos.d/litespeed.repo

Install OpenLiteSpeed with following command:

dnf install openlitespeed

After you have installed OpenLiteSpeed install Extra Packages for Enterprise Linux (EPEL) repository with following command:

dnf install epel-release

After that install PHP 8.1 for OpenLiteSpeed with most commonly used packages:

dnf install lsphp81 lsphp81-common lsphp81-mysqlnd lsphp81-gd lsphp81-process lsphp81-mbstring lsphp81-xml lsphp81-opcache

If you wish to install a different version of PHP just replace lsphp81 with lsphp80 for PHP 8.0 or lsphp74 for PHP 7.4 and similar.

By default OpenLiteSpeed will run on port 8088 and its WebAdmin Console will run on port 7080.

OpenLiteSpeed WebAdmin Console will have default username admin but the admin password will be randomly generated.

If you want to reset OpenLiteSpeed admin password you can run /usr/local/lsws/admin/misc/admpass.sh script which can be used to set admin password to desired value.

If you run the script it will use username admin if you don’t specify any and will then ask you to input a new password for OpenLiteSpeed administration web interface.

/usr/local/lsws/admin/misc/admpass.sh 

Please specify the user name of administrator.
This is the user name required to login the administration Web interface.

User name [admin]: 

Please specify the administrator's password.
This is the password required to login the administration Web interface.

Password: 
Retype password: 
Administrator's username/password is updated successfully!

How to install pdo_pgsql on cPanel server

When you try to install PHP Pecl module PDO_PGSQL, through WHM by going to Home »Software »Module Installers, you might be presented with the following error:

compilation terminated.
make: *** [pdo_pgsql.lo] Error 1
ERROR: `make' failed
The PDO_PGSQL.so object is not in /usr/local/lib/php/extensions/no-debug-non-zts-20131226
Tidying /usr/local/cpanel/3rdparty/php/56/etc/php.ini...
No changes
Tidying /usr/local/lib/php.ini...
 Skipping duplicate extension: pdo_pgsql.so
Wrote changes

You might also get a similar error when trying to install pdo_pgsql through shell with pecl install pdo_pgsql.

creating libtool
appending configuration tag "CXX" to libtool
configure: creating ./config.status
config.status: creating config.h
running: make
/bin/sh /root/tmp/pear/pear-build-roottXvx5k/PDO_PGSQL-1.0.2/libtool --mode=compile cc -I  -I. -I/root/tmp/pear/PDO_PGSQL -DPHP_ATOM_INC -I/root/tmp/pear/pear-build-roottXvx5k/PDO_PGSQL-1.0.2/include -I/root/tmp/pear/pear-build-roottXvx5k/PDO_PGSQL-1.0.2/main
-I/root/tmp/pear/PDO_PGSQL -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib  -DHAVE_CONFIG_H  -g -O2   -c /root/tmp/pear/PDO_PGSQL/pdo_pgsql.c -o pdo_pgsql.lo
mkdir .libs
 cc -I -I. -I/root/tmp/pear/PDO_PGSQL -DPHP_ATOM_INC -I/root/tmp/pear/pear-build-roottXvx5k/PDO_PGSQL-1.0.2/include -I/root/tmp/pear/pear-build-roottXvx5k/PDO_PGSQL-1.0.2/main -I/root/tmp/pear/PDO_PGSQL -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /root/tmp/pear/PDO_PGSQL/pdo_pgsql.c  -fPIC -DPIC -o .libs/pdo_pgsql.o
/root/tmp/pear/PDO_PGSQL/pdo_pgsql.c:22:20: fatal error: config.h: No such file or directory
 #include "config.h"
                    ^
compilation terminated.
make: *** [pdo_pgsql.lo] Error 1
ERROR: `make' failed

You can install pdo_pgsql by downloading and compiling it manually using following set of commands:

wget http://pecl.php.net/get/PDO_PGSQL-1.0.2.tgz
tar -xzf PDO_PGSQL-1.0.2.tgz
cd PDO_PGSQL-1.0.2/
phpize
./configure
make && make install
echo "extension=pdo_pgsql.so" >> /usr/local/lib/php.ini
Reference:

https://forums.cpanel.net/threads/unable-to-install-pdo_pgsql.554271/

How to Install ionCube Loader 5 on cPanel/WHM server

At this moment cPanel does not support ionCube Loader 5 on WHM/cPanel servers, which will cause issues for client running files made with ionCube v9.

cPanel currently installs ionCube PHP Loader v4.7.5, when you install PHP using cPanel EasyApache utility.

Your standard php -v output on cPanel server might look something like this.

root@server [~]# php -v
PHP 5.4.45 (cli) (built: Dec 14 2015 17:18:43)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
with the ionCube PHP Loader v4.7.5, Copyright (c) 2002-2014, by ionCube Ltd.

If you want to install, or upgrade current ionCube PHP Loader on your server to version 5, you can do so manually by downloading the latest version from http://www.ioncube.com/loaders.php, and editing your global or account custom php.ini file.

How to install ionCube Loader manually on cPanel or standard Linux servers with no control panel.

Download the latest loader to your server from http://www.ioncube.com/loaders.php.

If you are running 32 bit server used the following command:

wget http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86.tar.gz

If you are running 64 bit server use the following command:

wget http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz

Unpack the package:

On 32 bit server:

tar xvzf ioncube_loaders_lin_x86.tar.gz

On 64 bit server:

tar xvzf ioncube_loaders_lin_x86-64.tar.gz

It will create ioncube folder in the same directory where you downloaded the file.

If you need to install ionCube Loader for PHP 5.4  you will use ioncube_loader_lin_5.4* files, and if you need to install it for PHP 5.5 you will use ioncube_loader_lin_5.5* files, and similar for other PHP versions.

root@server [~]# ls ioncube
./                             ioncube_loader_lin_4.4_ts.so*  ioncube_loader_lin_5.3.so*     ioncube_loader_lin_5.6_ts.so*
../                            ioncube_loader_lin_5.0.so*     ioncube_loader_lin_5.3_ts.so*  LICENSE.txt
ioncube_loader_lin_4.1.so*     ioncube_loader_lin_5.0_ts.so*  ioncube_loader_lin_5.4.so*     loader-wizard.php
ioncube_loader_lin_4.2.so*     ioncube_loader_lin_5.1.so*     ioncube_loader_lin_5.4_ts.so*  README.txt
ioncube_loader_lin_4.3.so*     ioncube_loader_lin_5.1_ts.so*  ioncube_loader_lin_5.5.so*     USER-GUIDE.md
ioncube_loader_lin_4.3_ts.so*  ioncube_loader_lin_5.2.so*     ioncube_loader_lin_5.5_ts.so*  USER-GUIDE.txt
ioncube_loader_lin_4.4.so*     ioncube_loader_lin_5.2_ts.so*  ioncube_loader_lin_5.6.so*
root@server [~]#

To replace the ionCube Loader for all the users on the server, you can just replace the extension file defined in the global php.ini at /usr/local/lib/php.ini

root@server [~]# grep zend_extension /usr/local/lib/php.ini
zend_extension="/usr/local/IonCube/ioncube_loader_lin_5.4.so"
root@server [~]#

You can rename the original file, for restore purposes, if something goes wrong, and place the new version file from ioncube folder that was created with package extraction.

mv /usr/local/IonCube/ioncube_loader_lin_5.4_ts.so /usr/local/IonCube/ioncube_loader_lin_5.4_ts.so_cporig
mv /usr/local/IonCube/ioncube_loader_lin_5.4.so /usr/local/IonCube/ioncube_loader_lin_5.4.so_cporig
cp ioncube/ioncube_loader_lin_5.4.so /usr/local/IonCube/
cp ioncube/ioncube_loader_lin_5.4_ts.so /usr/local/IonCube/

You can confirm the new version of ionCube Loader with php -v, and look for “ionCube PHP Loader” part of the output.

root@server [~]# php -v
PHP 5.4.45 (cli) (built: Dec 14 2015 17:18:43)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
    with the ionCube PHP Loader (enabled) + Intrusion Protection from ioncube24.com (unconfigured) v5.0.19, Copyright (c) 2002-2015, by ionCube Ltd.
root@server [~]# php -v | grep "ionCube PHP Loader"
    with the ionCube PHP Loader (enabled) + Intrusion Protection from ioncube24.com (unconfigured) v5.0.19, Copyright (c) 2002-2015, by ionCube Ltd.
root@server [~]#

Upgrade to ionCube Loader 5 on one cPanel account.

If you wanted to change the ion Cube Loader version for only one cPanel account, you can place the ioncube_loader_lin* files for the PHP version used by your client to some custom folder, and define zend_extension values inside a custom php.ini folder on a specific cPanel account.

tl;dr

ionCube Loader can be installed manually on any Linux server with following steps:

  1. Download latest version of ionCube Loaders from http://www.ioncube.com/loaders.php
  2. Unpack the downloaded package
  3. move the ioncube_loader_lin_* files for your PHP version to your extension folder.
  4. Point to the corresponding file in your php.ini file, example
    zend_extension="/usr/local/IonCube/ioncube_loader_lin_5.4.so"