Report this

What is the reason for this report?

upgrading from php7.0 to 7.3

Posted on August 2, 2020

Hey,

I’m having trouble with upgrading my PHP version from 7.0 TO 7.3

I’m getting an error when trying to install PHP 7.3 using YUM

Error: Package: php70u-fpm-httpd-7.0.32-1.ius.centos7.noarch (@ius)
           Requires: php70u-fpm = 7.0.32-1.ius.centos7
           Removing: php70u-fpm-7.0.32-1.ius.centos7.x86_64 (@ius)
               php70u-fpm = 7.0.32-1.ius.centos7
           Obsoleted By: php-fpm-7.3.20-1.el7.remi.x86_64 (remi-php73)
               Not found
Error: Package: php70u-fpm-nginx-7.0.32-1.ius.centos7.noarch (@ius)
           Requires: php70u-fpm = 7.0.32-1.ius.centos7
           Removing: php70u-fpm-7.0.32-1.ius.centos7.x86_64 (@ius)
               php70u-fpm = 7.0.32-1.ius.centos7
           Obsoleted By: php-fpm-7.3.20-1.el7.remi.x86_64 (remi-php73)
               Not found
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

at first, I disabled the original Remi repo for php7.0 using the yum-config-manager --disable and then enabled the new repo 7.3

what can I do to resolve this? I’m using centos 7.6 and I don’t want to completely delete PHP since this is a production server

Thanks!



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hello, @omercohen

I will recommend you to take a snapshot of your server before making any changes as this is a production server.

You can try to install PHP 7.3 using the EPEL and Remi repository on your CentOS server:

1 . Enable EPEL and Remi

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

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

2 . install yum-utils,

yum install yum-utils

3 . Use the yum-config manager to enable the remi PHP 7.3 as the default repository for installing this specific PHP version:

yum-config-manager --enable remi-php73

4 . You can now install all the needed PHP modules:

yum install php php-mcrypt php-cli php-gd php-curl php-mysql php-ldap php-zip php-fileinfo

Note: If there is another extension you need just add it in the command above in order to install it. I will also recommend you to take a snapshot of your server before making any changes as this is a production server and it’s vital to have a working copy of your current server environment before you go and make config changes.

You can check if everything is okay with the following command:

php -v

The expected output will be:

Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.1, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.3.1, Copyright (c) 1999-2018, by Zend Technologies```

Hope that this helps!
Regards,
Alex

For anyone stumbling upon this one, here a detailed steps on how you can upgrade from PHP 7.0 to 8.3 incase anyone needs a newer version.

The error you’re encountering when upgrading PHP from 7.0 to 8.3 on CentOS 7 using YUM involves repository conflicts and dependency issues, particularly with packages installed from the IUS repository that are not properly replaced or upgraded by those from the Remi repository. This can be tricky on a production server where you cannot simply remove PHP without downtime. Here’s a step-by-step approach to safely upgrade your PHP version:

Step 1: Prepare the System

  1. Backup your current PHP configuration and any other critical data. This is essential before making major changes on a production server.

  2. Remove or disable IUS repository, as it may cause conflicts with the Remi repository for newer PHP versions:

yum remove 'ius-release'
  1. Ensure the Remi repository is installed and enabled for the desired PHP version:
yum install https://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum-config-manager --enable remi-php83

Step 2: Resolve Dependency Issues

  1. Identify and remove conflicting packages. First, list them:
rpm -qa | grep php70u

Remove the PHP 7.0 packages:

yum remove php70u\*
  1. Be careful with this command as it might also remove extensions and modules you might want to keep. Check the list carefully before confirming the removal.

Step 3: Install PHP 8.3

  1. Clean YUM cache to ensure it reads from the updated repositories:
yum clean all
  1. Install PHP 8.3: ``bash yum install php php-cli php-fpm php-common
You might need to install additional PHP modules that your applications require. You can search for available PHP modules by:
```bash
yum search php-

Check PHP version to confirm the upgrade:

php -v

Step 4: Configure PHP 8.3

  1. Update PHP configuration files if necessary. Since PHP versions can have different directives and deprecated features, you’ll need to review and possibly modify php.ini and other related configuration files.

  2. Migrate and test PHP configurations and websites to ensure compatibility with PHP 8.3. Pay attention to deprecated features and incompatible changes.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.