1 (edited by Alec 2022-07-06 22:07:15)

Topic: Update PHP 7.3 to 8.

Hello!

I was assigned a task to update the version 7.3 of php from a server to the latest 8.0 version. I'm using a rocky linux server and i have the following modules loaded to php.


PHP Modules
bcmath
bz2
calendar
Core
ctype
curl
date
dom
exif
fileinfo
filter
ftp
gd
gettext
hash
iconv
interbase
json
libxml
mbstring
openssl
pcntl
pcre
PDO
PDO_Firebird
pdo_pgsql
pdo_sqlite
pdo_sqlsrv
pgsql
Phar
readline
Reflection
session
SimpleXML
sockets
SPL
sqlite3
sqlsrv
standard
tokenizer
wddx
xml
xmlreader
xmlwriter
xsl
Zend OPcache
zip
zlib

Zend Modules
Zend OPcache

And i also have these installed packages on my rocky linux:

"
yum list --installed | grep php

gd3php.x86_64                        2.3.3-4.el8.remi                          @remi-safe
oniguruma5php.x86_64                 6.9.8-1.el8.remi                          @remi-safe
php.x86_64                           7.3.33-3.el8.remi                         @remi-modular
php-bcmath.x86_64                    7.3.33-3.el8.remi                         @remi-modular
php-cli.x86_64                       7.3.33-3.el8.remi                         @remi-modular
php-common.x86_64                    7.3.33-3.el8.remi                         @remi-modular
php-fpm.x86_64                       7.3.33-3.el8.remi                         @remi-modular
php-gd.x86_64                        7.3.33-3.el8.remi                         @remi-modular
php-interbase.x86_64                 7.3.33-3.el8.remi                         @remi-modular
php-json.x86_64                      7.3.33-3.el8.remi                         @remi-modular
php-mbstring.x86_64                  7.3.33-3.el8.remi                         @remi-modular
php-opcache.x86_64                   7.3.33-3.el8.remi                         @remi-modular
php-pdo.x86_64                       7.3.33-3.el8.remi                         @remi-modular
php-pecl-zip.x86_64                  1.20.1-1.el8.remi.7.3                     @remi-modular
php-pgsql.x86_64                     7.3.33-3.el8.remi                         @remi-modular
php-sqlsrv.x86_64                    5.10.1-1.el8.remi.7.3                     @remi-modular
php-xml.x86_64                       7.3.33-3.el8.remi                         @remi-modular
"

I searched about this situation and i encountered a lot of ways to update it.

I could remove all the php packages with a "yum remove php*", then disable the repository from the current php version with "dnf module disable php:remi-7.3", then enable the 8.0 module with "dnf module enable php:remi-8.0" and then reinstall all of php packages again.

I really dont know if that would work because i'm a noob with rhel and i also found this post -> forums.rockylinux.org/t/how-do-i-get-to-the-latest-httpd-and-php/4783/2 where remi quotes about a "dnf module reset php" and a "dnf module enable php:7.4", in which got me thinking about only disabling the current repository, enabling the new one and do a yum update to update all packages to the php 8.0 variants, does this makes sense or i'm completely wrong and there is another way to do that?

Sorry for the long post and for my english, thank you for any advise.

Re: Update PHP 7.3 to 8.

Simply follow the wizard instructions wink
(link on all pages... on the top / right)

BTW in your case the upgrade will be impossible because of php-interbase which  have been removed in 7.4 and is no more available.

If you really use it you cannot update
If you can remove it, you can update

Notice: the pdo driver is still available in the php-pdo-firebird package.

https://www.php.net/ibase
https://www.php.net/pdo_firebird

Desktop: Fedora 35 + rpmfusion + remi-test + remi-dev
Laptop:  Fedora 36 + rpmfusion + remi (SCL only)
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: Update PHP 7.3 to 8.

Hi Remi,

Thank's for the quick response, i really have not seen the wizard, sorry for that, in that case before i follow the wizard instructions i should only remove the existing php packages right?

Re: Update PHP 7.3 to 8.

> i should only remove the existing php packages right?

only php-interbase, if you don't need it

(so the same set of extensions will be available after the update)

Desktop: Fedora 35 + rpmfusion + remi-test + remi-dev
Laptop:  Fedora 36 + rpmfusion + remi (SCL only)
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: Update PHP 7.3 to 8.

Hi again Remi, thanks for the response,

Sorry to be bothering you, but I really dont understand the modularity of the system, but if i understood right by what you're saying, if i only remove the unused package (interbase in that case), then follow those two simple steps of the wizard -> prnt.sc/3f3u-NnKvZVN (because i already have downloaded the epel and remi repos) the existing packages would be updated?

Because today most of them have that "7.3.33-3.el8" prefix in the version name, isnt that an allusion to the current php version i'm using? and with that, wouldnt yum be lost if i try to update packages with "older" versions from other module?

If i really just need to remove the unused package and change the module for a complete php version change that would be magic for me tongue.

Re: Update PHP 7.3 to 8.

Yes, It's a kind of magick
Thanks to the Wizard

Desktop: Fedora 35 + rpmfusion + remi-test + remi-dev
Laptop:  Fedora 36 + rpmfusion + remi (SCL only)
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: Update PHP 7.3 to 8.

Hi Remi,

I followed the tutorial and everything is working as expected, thank you very much!

Re: Update PHP 7.3 to 8.

smile

Desktop: Fedora 35 + rpmfusion + remi-test + remi-dev
Laptop:  Fedora 36 + rpmfusion + remi (SCL only)
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi