Php 8.1 error in INSTALL PHP EXTENSIONS

Your best option to get php 8.1 working is to compile it. My example uses Centos 7
Cyberpanel has php 8.0 and php 8.1 but some extensions are missing and cannot be installe.

You first have to update this file: /usr/local/lsws/admin/html/lib/util/build_php/BuildConfig.php
You want to do 2 things.
My example is using the latest version of php 8.1 but you can always add more versions as they come out

  1. Add php 8.1.9 to the list of PHP_VERSION
    image

  2. Update LSAPI to the latest version which supports php 8
    case self::LSAPI_VERSION: return ‘8.0.1’;
    image

Next you want to go to (https://example.com:7080/index.php#view/compilePHP.php)
From here select php 8.1.9 and click next
Set install path to: /usr/local/lsws/lsphp81 so it will replace the current php 8.1
Set Configure Parameters *. I used the following:

–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-bcmath --with-kerberos --with-system-ciphers --with-bz2 --enable-calendar --enable-dba --with-enchant --enable-exif --with-gettext --with-gmp --with-mhash --with-kerberos --enable-intl --with-ldap --with-libdir=lib64 --with-ldap-sasl --with-mysql-sock --enable-pcntl --with-pdo-mysql --with-pdo-pgsql --enable-sysvmsg --enable-sysvsem --enable-sysvshm --with-xsl --enable-mysqlnd --with-pear

Click next, let the script run till you see “Done” then click next again

You will run into a number of errors because of dependencies but they are simple to solve as there are most likely missing devels in your system. To solve this, install those missing devels before going on to the next step.

yum install -y postgresql-devel openldap-devel gmp-devel enchant-devel bzip2-devel oniguruma-devel libxml2-devel sqlite3-devel icu libicu-devel libxslt-devel libsodium libsodium-devel

Follow the instructions by running /usr/local/lsws/phpbuild/buildphp_manual_run.sh

If you get any error you can do a search and install the devel and rerun the last script.
e.g. yum search oniguruma
The above will give a list of packages, from there select the devel and install
e.g. yum install -y oniguruma-devel

I now have php 8.1 running with all extensions that I require.

1 Like