Christopher Juckins

SysAdmin Tips, Tricks and other Software Tools

User Tools

Site Tools


centos_php8.1_upgrade

This is an old revision of the document!


Rocky Linux PHP 8.1 Upgrade

Pre-existing PHP 7.4 RPMs:

[root@tidewater: ~]# rpm -qa |grep php | sort
oniguruma5php-6.9.7.1-1.el7.remi.x86_64
php-7.4.28-1.el7.remi.x86_64
php-cli-7.4.28-1.el7.remi.x86_64
php-common-7.4.28-1.el7.remi.x86_64
php-json-7.4.28-1.el7.remi.x86_64
php-mbstring-7.4.28-1.el7.remi.x86_64
php-mysqlnd-7.4.28-1.el7.remi.x86_64
php-pdo-7.4.28-1.el7.remi.x86_64
php-pecl-mcrypt-1.0.4-1.el7.remi.7.4.x86_64
php-sodium-7.4.28-1.el7.remi.x86_64
php-xml-7.4.28-1.el7.remi.x86_64

Install PHP 8.1 on 6 March 2022 using https://computingforgeeks.com/how-to-install-php-centos-rhel-linux/

yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum install https://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum install yum-utils
yum-config-manager --disable 'remi-php*'
yum-config-manager --enable remi-php81
yum repolist
#yum install php php-{cli,fpm,mysqlnd,zip,devel,gd,mbstring,curl,xml,pear,bcmath,json,opcache,redis,memcache}
yum install php php-{cli,common,json,mbstring,mysqlnd,pdo,pecl-mcrypt,sodium,xml}

After installation, PHP 8.1 RPMs include the following:

[root@tidewater: ~]# rpm -qa |grep php | sort
oniguruma5php-6.9.7.1-1.el7.remi.x86_64
php-8.1.3-1.el7.remi.x86_64
php-cli-8.1.3-1.el7.remi.x86_64
php-common-8.1.3-1.el7.remi.x86_64
php-mbstring-8.1.3-1.el7.remi.x86_64
php-mysqlnd-8.1.3-1.el7.remi.x86_64
php-pdo-8.1.3-1.el7.remi.x86_64
php-pecl-mcrypt-1.0.4-5.el7.remi.8.1.x86_64
php-sodium-8.1.3-1.el7.remi.x86_64
php-xml-8.1.3-1.el7.remi.x86_64

Now these errors appear:

Deprecated: Constant FILTER_SANITIZE_STRING is deprecated in ...

Fix is explained at Stack Overflow and 2 options are the following:

  • use FILTER_SANITIZE_FULL_SPECIAL_CHARS
  • use FILTER_UNSAFE_RAW

NOTE: 7 March 2022

  • Had to back out to PHP v7.4
    • Local copy of Dokuwiki would not render correctly
    • Local TAT http wget was failing
centos_php8.1_upgrade.1654095740.txt.gz · Last modified: 2022/06/01 11:02 by juckins