CentOS 7.9 Core PHP 7.2 to 7.4 Upgrade

We are currently running on PHP version 7.2 I’m trying to get us upgraded to release 7.4, and I’m running into the following error when I validate PHP.

Steps…

yum update -y
yum install epel-release
rpm -Uvh http://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum list installed php*
yum remove php*
yum install --enablerepo=remi-php72 php php-mcrypt php-cli php-gd php-curl php-mysql php-ldap php-zip php-fileinfo

php -v

PHP 7.4.12 (cli) (built: Oct 27 2020 15:01:52) ( NTS )
Copyright © The PHP Group
Zend Engine v3.4.0, Copyright © Zend Technologies

-bash-4.2$ ./validate.php

In AppServiceProvider.php line 43:

Call to undefined method Illuminate\Pagination\Paginator::useBootstrap()

PHP Fatal error: Uncaught ErrorException: Undefined index: openssl_ver in /opt/librenms/validate.php:166
Stack trace:
#0 /opt/librenms/validate.php(166): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError()
#1 /opt/librenms/validate.php(83): print_header()
#2 [internal function]: {closure}()
#3 {main}

thrown in /opt/librenms/validate.php on line 166

Whty are you enabling 7.2?

Sorry that was a mistake on my part, copied incorrectly.

yum install --enablerepo=remi-php74 php php-mcrypt php-cli php-gd php-curl php-mysql php-ldap php-

you need to remove 7.2

grep for 7.2 and remove all the packages

rpm -qa | grep PHP

and then yum install all of the 7.4 PHP packages

1 Like

The following fixed the issue, hopefully this will help others…

yum list installed php72* or rpm -aq | grep -i php72*

yum remove installed php72*

yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

yum -y install https://rpms.remirepo.net/enterprise/remi-release-7.rpm

yum -y install yum-utils

yum-config-manager --enable remi-php74

yum update

yum install php php-cli

yum install php php-cli php-fpm php-mysqlnd php-zip php-devel php-gd php-mcrypt php-mbstring php-curl php-xml php-pear php-bcmath php-json

php -v

su - librenms
./daily.sh

systemctl restart httpd

4 Likes

This worked perfectly to bring me up to php7.4. Thank you, you saved me a ton of time!

This topic was automatically closed 730 days after the last reply. New replies are no longer allowed.