Search code examples
phpcentos7php-8.1

PHP 8.1 Update problems with CentOS 7.9


I'm attempting to update a production web server (on linode) from php 7.1 to 8.1, following the instructions on the configuration wizard, but there seems to be a dependency tree error, and I'm hesitant to use --skip-broken in case it breaks my web server. Is that the best thing to do? Can I easily revert updates if I'm not able to resolve the dependency after updating? Should I update to a more recent 7.x version first? Here's the output of yum update:

sudo yum update
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: atl.mirrors.clouvider.net
 * epel: d2lzkl7pfhq30w.cloudfront.net
 * extras: mirrors.linode.com
 * remi-php81: mirror.pit.teraswitch.com
 * updates: mirrors.linode.com
remi-php81
remi-php81/primary_db
Resolving Dependencies
--> Running transaction check
---> Package php-cli.x86_64 0:7.1.33-19.el7.remi will be updated
---> Package php-cli.x86_64 0:8.1.6-1.el7.remi will be an update
---> Package php-common.x86_64 0:7.1.33-19.el7.remi will be updated
--> Processing Dependency: php(api) = 20160303-64 for package: php-pecl-apcu-bc-1.0.5-1.el7.remi.7.1.x86_64
--> Processing Dependency: php(zend-abi) = 20160303-64 for package: php-pecl-apcu-bc-1.0.5-1.el7.remi.7.1.x86_64
---> Package php-common.x86_64 0:8.1.6-1.el7.remi will be obsoleting
---> Package php-fpm.x86_64 0:7.1.33-19.el7.remi will be updated
---> Package php-fpm.x86_64 0:8.1.6-1.el7.remi will be an update
---> Package php-gd.x86_64 0:7.1.33-19.el7.remi will be updated
---> Package php-gd.x86_64 0:8.1.6-1.el7.remi will be an update
--> Processing Dependency: libgd.so.103()(64bit) for package: php-gd-8.1.6-1.el7.remi.x86_64
---> Package php-json.x86_64 0:7.1.33-19.el7.remi will be obsoleted
---> Package php-mbstring.x86_64 0:7.1.33-19.el7.remi will be updated
---> Package php-mbstring.x86_64 0:8.1.6-1.el7.remi will be an update
--> Processing Dependency: libonig.so.105()(64bit) for package: php-mbstring-8.1.6-1.el7.remi.x86_64
---> Package php-mcrypt.x86_64 0:7.1.33-19.el7.remi will be obsoleted
---> Package php-mysqlnd.x86_64 0:7.1.33-19.el7.remi will be updated
---> Package php-mysqlnd.x86_64 0:8.1.6-1.el7.remi will be an update
---> Package php-opcache.x86_64 0:7.1.33-19.el7.remi will be updated
---> Package php-opcache.x86_64 0:8.1.6-1.el7.remi will be an update
---> Package php-pdo.x86_64 0:7.1.33-19.el7.remi will be updated
---> Package php-pdo.x86_64 0:8.1.6-1.el7.remi will be an update
---> Package php-pecl-apcu.x86_64 0:5.1.21-1.el7.remi.7.1 will be updated
---> Package php-pecl-apcu.x86_64 0:5.1.21-1.el7.remi.8.1 will be an update
---> Package php-pecl-igbinary.x86_64 0:3.2.7-1.el7.remi.7.1 will be updated
---> Package php-pecl-igbinary.x86_64 0:3.2.7-1.el7.remi.8.1 will be an update
---> Package php-pecl-mcrypt.x86_64 0:1.0.5-1.el7.remi.8.1 will be obsoleting
---> Package php-pecl-memcache.x86_64 0:4.0.5.2-1.el7.remi.7.1 will be updated
---> Package php-pecl-memcache.x86_64 0:8.0-3.el7.remi.8.1 will be an update
---> Package php-pecl-memcached.x86_64 0:3.2.0-1.el7.remi.7.1 will be updated
---> Package php-pecl-memcached.x86_64 0:3.2.0-1.el7.remi.8.1 will be an update
---> Package php-pecl-mongodb.x86_64 0:1.11.1-1.el7.remi.7.1 will be updated
---> Package php-pecl-mongodb.x86_64 0:1.13.0-1.el7.remi.8.1 will be an update
---> Package php-pecl-msgpack.x86_64 0:2.1.2-1.el7.remi.7.1 will be updated
---> Package php-pecl-msgpack.x86_64 0:2.2.0~RC1-4.el7.remi.8.1 will be an update
---> Package php-pecl-redis.x86_64 0:3.1.6-1.el7.remi.7.1 will be obsoleted
---> Package php-pecl-redis5.x86_64 0:5.3.7-1.el7.remi.8.1 will be obsoleting
--> Processing Dependency: liblzf.so.1()(64bit) for package: php-pecl-redis5-5.3.7-1.el7.remi.8.1.x86_64
--> Processing Dependency: libzstd.so.1()(64bit) for package: php-pecl-redis5-5.3.7-1.el7.remi.8.1.x86_64
---> Package php-pgsql.x86_64 0:7.1.33-19.el7.remi will be updated
---> Package php-pgsql.x86_64 0:8.1.6-1.el7.remi will be an update
---> Package php-process.x86_64 0:7.1.33-19.el7.remi will be updated
---> Package php-process.x86_64 0:8.1.6-1.el7.remi will be an update
---> Package php-xml.x86_64 0:7.1.33-19.el7.remi will be updated
---> Package php-xml.x86_64 0:8.1.6-1.el7.remi will be an update
--> Running transaction check
---> Package liblzf.x86_64 0:3.6-7.el7 will be installed
---> Package libzstd.x86_64 0:1.5.2-1.el7 will be installed
---> Package php-common.x86_64 0:7.1.33-19.el7.remi will be updated
--> Processing Dependency: php(api) = 20160303-64 for package: php-pecl-apcu-bc-1.0.5-1.el7.remi.7.1.x86_64
--> Processing Dependency: php(zend-abi) = 20160303-64 for package: php-pecl-apcu-bc-1.0.5-1.el7.remi.7.1.x86_64
---> Package php-gd.x86_64 0:8.1.6-1.el7.remi will be an update
--> Processing Dependency: libgd.so.103()(64bit) for package: php-gd-8.1.6-1.el7.remi.x86_64
---> Package php-mbstring.x86_64 0:8.1.6-1.el7.remi will be an update
--> Processing Dependency: libonig.so.105()(64bit) for package: php-mbstring-8.1.6-1.el7.remi.x86_64
--> Finished Dependency Resolution
Error: Package: php-pecl-apcu-bc-1.0.5-1.el7.remi.7.1.x86_64 (@remi-php71)
           Requires: php(api) = 20160303-64
           Removing: php-common-7.1.33-19.el7.remi.x86_64 (@remi-php71)
               php(api) = 20160303-64
           Updated By: php-common-8.1.6-1.el7.remi.x86_64 (remi-php81)
               php(api) = 20210902-64
           Available: php-common-5.4.16-48.el7.x86_64 (base)
               php(api) = 20100412-64
           Available: php-common-8.1.5-1.el7.remi.x86_64 (remi-php81)
               php(api) = 20210902-64
Error: Package: php-gd-8.1.6-1.el7.remi.x86_64 (remi-php81)
           Requires: libgd.so.103()(64bit)
Error: Package: php-pecl-apcu-bc-1.0.5-1.el7.remi.7.1.x86_64 (@remi-php71)
           Requires: php(zend-abi) = 20160303-64
           Removing: php-common-7.1.33-19.el7.remi.x86_64 (@remi-php71)
               php(zend-abi) = 20160303-64
           Updated By: php-common-8.1.6-1.el7.remi.x86_64 (remi-php81)
               php(zend-abi) = 20210902-64
           Available: php-common-5.4.16-48.el7.x86_64 (base)
               php(zend-abi) = 20100525-64
           Available: php-common-8.1.5-1.el7.remi.x86_64 (remi-php81)
               php(zend-abi) = 20210902-64
Error: Package: php-mbstring-8.1.6-1.el7.remi.x86_64 (remi-php81)
           Requires: libonig.so.105()(64bit)
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

Solution

  • Error: Package: php-pecl-apcu-bc-1.0.5-1.el7.remi.7.1.x86_64 (@remi-php71)
              Requires: php(api) = 20160303-64
    

    The apcu_bc provides a compatibility with the old APC extension for PHP 7.

    It is deprecated, and no more supported for PHP 8.

    So you have to remove it before the upgrade, if you really need it, you cannot upgrade and have to fix the application using it before being able to upgrade.

     Error: Package: php-gd-8.1.6-1.el7.remi.x86_64 (remi-php81)
               Requires: libgd.so.103()(64bit)
    

    Missing dependency is in the remi-safe repository which is enabled by default in a proper installation, following the wizard instructions

    Of course, as this is a major upgrade, you have to ensure all your applications are ready for this new version.