PHP Upgrade to 8.1

Update Packages

Warning

Please use the Sury repository to install the PHP packages.

View their README.txt to add the required repository to debian sources.

Update the apt pinning configuration /etc/apt/preferences.d/sury with following content:

Package: php5.6*, php7.0*, php7.1*, php7.2*, php7.3*, php7.4*, php8.0*, php8.2*
Pin: release *
Pin-Priority: -1

Now install the new php8.1 packages apt configuration install the php packages:

$ apt install libapache2-mod-php8.1 php-common php8.1 php8.1-bcmath \
  php8.1-bz2 php8.1-cli php8.1-common php8.1-curl php8.1-gd php8.1-igbinary \
  php8.1-imap php8.1-intl php8.1-ldap php8.1-mailparse \
  php8.1-mbstring php8.1-mysql php8.1-opcache php8.1-readline php8.1-soap \
  php8.1-ssh2 php8.1-tidy php8.1-xml php8.1-xmlrpc php8.1-zip

Update Configurations

PHP8.1

Copy php and opcache configuration from /etc/php/7.4/mods-available/ to /etc/php/8.1/mods-available/. The files typically called custom-php.ini and custom-opcache.ini.

After copying the configurations must be enabled again by typing phpenmod custom-php and phpenmod custom-opcache.

For full configuration see: PHP: Configuration

Disable default opcache configuration by typing phpdismod opcache.

Apache

Disable old php7.4 module, enable new php8.1 module and restart apache service.

a2dismod php7.4 && a2enmod php8.1

systemctl restart apache2.service
Verify php was successfully upgraded by typing php -v and check the output.
The output should look like:
PHP 8.1.18 (cli) (built: Apr 14 2023 04:39:46) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.18, Copyright (c) Zend Technologies
    with SourceGuardian v14.0.2, Copyright (c) 2000-2023, by SourceGuardian Ltd.
    with Zend OPcache v8.1.18, Copyright (c), by Zend Technologies

SourceGuardian Loader

Install SourceGuardian it will be used in the future instead of ionCube Loader.

Is responsible for the decryption and thus the runnability of CRM+. Available at:

Linux (x86-64) https://www.sourceguardian.com/loaders/download/loaders.linux-x86_64.tar.gz

wget --user-agent="Chrome/51.0.2704.103" https://www.sourceguardian.com/loaders/download/loaders.linux-x86_64.tar.gz

If the download link does not work anymore, you will also find the available packages via the main domain: https://www.sourceguardian.com/loaders.html

Unzip the downloaded package to /opt/thirdparty/sourceguardian.

Create the file /etc/php/8.1/mods-available/custom-sourceguardian.ini with following content, after creating the file enable the module by typing phpenmod custom-sourceguardian.

; Custom configuration for php8.1 module
; priority=00

zend_extension = /opt/thirdparty/sourceguardian/ixed.8.1.lin

Verify SourceGuardian was successfull installed by typing php -v and check for the SourceGuardian section.

For full configuration see: SourceGuardian Loader: Installation

Cleanup PHP7.4 Packages

After successfull installation the php7.4 packages can be purged.

apt remove --purge $(dpkg -l | grep php7.4 | awk '{ print $2 }')
apt autoremove
apt autoclean