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!


CentOS 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 of PHP8.1, these errors will 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
centos_php8.1_upgrade.1646607936.txt.gz · Last modified: 2022/03/06 18:05 by juckins