Roundcube 1.4.11 and multiple PHP versions

Discussion in 'ISPConfig 3 Priority Support' started by felan, Feb 16, 2021.

  1. felan

    felan Member HowtoForge Supporter

    Hi :)
    Got some issues after latest updates to PHP from sury.org on my ispconfig setup.
    I have PHP 7.3, 7.4 and 8.0 installed, php 7.4 set as default for Apache and cmd.
    Code:
    PHP 7.4.15 (cli) (built: Feb 12 2021 14:48:10) ( NTS )
    Copyright (c) The PHP Group
    Zend Engine v3.4.0, Copyright (c) Zend Technologies
        with Zend OPcache v7.4.15, Copyright (c), by Zend Technologies
    When I try to re-install roundcube, after the latest updates, that removed roundcube, sadly, I get the following error:
    Code:
    root@server1 /etc/apache2/mods-enabled # apt-get install roundcube/buster-backports roundcube-core/buster-backports roundcube-plugins/buster-backports
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    Selected version '1.4.11+dfsg.1-1~bpo10+1' (Debian Backports:buster-backports [all]) for 'roundcube'
    Selected version '1.4.11+dfsg.1-1~bpo10+1' (Debian Backports:buster-backports [all]) for 'roundcube-core'
    Selected version '1.4.11+dfsg.1-1~bpo10+1' (Debian Backports:buster-backports [all]) for 'roundcube-plugins'
    Some packages could not be installed. This may mean that you have
    requested an impossible situation or if you are using the unstable
    distribution that some required packages have not yet been created
    or been moved out of Incoming.
    The following information may help to resolve the situation:
    
    The following packages have unmet dependencies:
     roundcube-core : Depends: libapache2-mod-php (< 2:8.0~) or
                               php (< 2:8.0~)
                      Depends: php-cli (< 2:8.0~)
                      Depends: php-intl (< 2:8.0~)
                      Depends: php-json (< 2:8.0~)
                      Depends: php-mbstring (< 2:8.0~)
    E: Unable to correct problems, you have held broken packages.
    Got any ideas? I mean everything is set to php 7.4 as defaults, but it still complains about PHP 8 >.<
     
  2. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

  3. felan

    felan Member HowtoForge Supporter

    Hi Thom.
    I already went through this and the odd thing is that it worked before the latest patches to PHP that came out a few days ago... What is more interesting is that it keep complaining about PHP 8 packages and want something smaller, which is installed. So that's the issue...
     
  4. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    What is the output of
    Code:
    ls -l /etc/alternatives/*php*
     
  5. felan

    felan Member HowtoForge Supporter

    Code:
    root@server1 /etc/apache2/mods-enabled # ls -l /etc/alternatives/*php*
    lrwxrwxrwx 1 root root 15 Nov  4 12:32 /etc/alternatives/php -> /usr/bin/php7.4
    lrwxrwxrwx 1 root root 31 Nov  4 12:32 /etc/alternatives/php.1.gz -> /usr/share/man/man1/php7.4.1.gz
    lrwxrwxrwx 1 root root 19 Nov  4 12:32 /etc/alternatives/php-cgi -> /usr/bin/php-cgi7.4
    lrwxrwxrwx 1 root root 35 Nov  4 12:32 /etc/alternatives/php-cgi.1.gz -> /usr/share/man/man1/php-cgi7.4.1.gz
    lrwxrwxrwx 1 root root 23 Nov  4 12:33 /etc/alternatives/php-cgi-bin -> /usr/lib/cgi-bin/php7.4
    lrwxrwxrwx 1 root root 24 Feb 14 20:57 /etc/alternatives/php-fpm.sock -> /run/php/php7.4-fpm.sock
     
    Last edited: Feb 16, 2021
  6. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    What is the output of
    Code:
    sudo apt-get install -f
     
  7. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    I have this same issue on Debian 10, packages seem to be changing and things are a bit of a mess right now. Previously I had roundcube 1.4.11 from buster-backports, and php versions from sury.org - the latest php updates caused roundcube to be uninstalled, and reinstalling it results in version 1.3.16. And if you've used the elastic skin from 1.4, you know you can't go back.

    Trying to force roundcube install from buster-backports has version issues and now also needs php-intl and php-json packages, which seems to be new (I have all the php#.#-intl and php#.#-json packages already .. my guess is previously they each had eg. 'Provides: php-json' and now they do not). Installing the default php-intl and php-json versions result in newer version 2:8.0+80~exp2+0~20210213.31+debian10~1.gbpf31826 and a quick check shows that version of several other php packages now:

    Code:
    # dpkg --list | grep 2:8.0+80
    ii  php                                2:8.0+80~exp2+0~20210213.31+debian10~1.gbpf31826                         all          server-side, HTML-embedded scripting language (default)
    ii  php-bcmath                         2:8.0+80~exp2+0~20210213.31+debian10~1.gbpf31826                         all          Bcmath module for PHP [default]
    ii  php-cgi                            2:8.0+80~exp2+0~20210213.31+debian10~1.gbpf31826                         all          server-side, HTML-embedded scripting language (CGI binary) (default)
    ii  php-cli                            2:8.0+80~exp2+0~20210213.31+debian10~1.gbpf31826                         all          command-line interpreter for the PHP scripting language (default)
    ii  php-fpm                            2:8.0+80~exp2+0~20210213.31+debian10~1.gbpf31826                         all          server-side, HTML-embedded scripting language (FPM-CGI binary) (default)
    ii  php-gmp                            2:8.0+80~exp2+0~20210213.31+debian10~1.gbpf31826                         all          GMP module for PHP [default]
    ii  php-mbstring                       2:8.0+80~exp2+0~20210213.31+debian10~1.gbpf31826                         all          MBSTRING module for PHP [default]
    ii  php-mysql                          2:8.0+80~exp2+0~20210213.31+debian10~1.gbpf31826                         all          MySQL module for PHP [default]
    ii  php-xml                            2:8.0+80~exp2+0~20210213.31+debian10~1.gbpf31826                         all          DOM, SimpleXML, WDDX, XML, and XSL module for PHP [default]
    
    Using apt policy I see there is also a 2:7.3+69 version of those packages:

    Code:
    # apt policy php php-cli php-intl php-json
    php:
      Installed: 2:8.0+80~exp2+0~20210213.31+debian10~1.gbpf31826
      Candidate: 2:8.0+80~exp2+0~20210213.31+debian10~1.gbpf31826
      Version table:
     *** 2:8.0+80~exp2+0~20210213.31+debian10~1.gbpf31826 500
            500 https://packages.sury.org/php buster/main amd64 Packages
            100 /var/lib/dpkg/status
         2:7.3+69 500
            500 http://deb.debian.org/debian buster/main amd64 Packages
    php-cli:
      Installed: 2:8.0+80~exp2+0~20210213.31+debian10~1.gbpf31826
      Candidate: 2:8.0+80~exp2+0~20210213.31+debian10~1.gbpf31826
      Version table:
     *** 2:8.0+80~exp2+0~20210213.31+debian10~1.gbpf31826 500
            500 https://packages.sury.org/php buster/main amd64 Packages
            100 /var/lib/dpkg/status
         2:7.3+69 500
            500 http://deb.debian.org/debian buster/main amd64 Packages
    php-intl:
      Installed: 2:8.0+80~exp2+0~20210213.31+debian10~1.gbpf31826
      Candidate: 2:8.0+80~exp2+0~20210213.31+debian10~1.gbpf31826
      Version table:
     *** 2:8.0+80~exp2+0~20210213.31+debian10~1.gbpf31826 500
            500 https://packages.sury.org/php buster/main amd64 Packages
            100 /var/lib/dpkg/status
         2:7.3+69 500
            500 http://deb.debian.org/debian buster/main amd64 Packages
    php-json:
      Installed: 2:8.0+80~exp2+0~20210213.31+debian10~1.gbpf31826
      Candidate: 2:8.0+80~exp2+0~20210213.31+debian10~1.gbpf31826
      Version table:
     *** 2:8.0+80~exp2+0~20210213.31+debian10~1.gbpf31826 500
            500 https://packages.sury.org/php buster/main amd64 Packages
            100 /var/lib/dpkg/status
         2:7.3+69 500
            500 http://deb.debian.org/debian buster/main amd64 Packages
    
    All the other packages have the same versions available as well. So I install those package versions version (php-bcmath didn't update, I had to uninstall it first, then install the older version):
    Code:
    # apt install php=2:7.3+69  php-cgi=2:7.3+69 php-cli=2:7.3+69 php-fpm=2:7.3+69 php-gmp=2:7.3+69 php-mbstring=2:7.3+69 php-mysql=2:7.3+69 php-xml=2:7.3+69 php-intl=2:7.3+69 php-json2:7.3+69
    # apt remove php-bcmath
    # apt install php-bcmath=2:7.3+69
    
    Then I was able to update roundcube to 1.4.11 again:
    Code:
    # apt -t buster-backports install roundcube roundcube-plugins roundcube-plugins-extra roundcube-core
    
    Roundcube is now back to 1.4 with the elastic theme. When uninstalling roundcube during package updates (yes, because I didn't read what was going to be removed), I chose to not remove the roundcube database, so all my config and settings are still there and things seem to be working fine.
     
    felan and Th0m like this.
  8. felan

    felan Member HowtoForge Supporter

    Hi Jesse.
    Thanks! That worked perfectly!
     
  9. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    It looks to me PHP 8.0 from Ondrej Sury repo makes PHP 8 the default. This causes issues when installing php meta packages, like apt install php-soad would install php8.0-soap.
    Solutions:
    1. Do not install PHP 8 or
    2. Do not install meta packages, install the real package, like apt install php7.3-soap.
    3. What might work , have not tried, is to install PHP 8 first and then install the default PHP for the OS. This may make the correct default PHP.
    My guess for the reason for this is PHP 8.0 is candidate for default PHP for next Debian release, where this behaviour would be expected.
     
    Jesse Norell likes this.
  10. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    It comes to mind that we'll probably need to pin those meta packages to the correct version to avoid this at the next update.
     
    felan likes this.
  11. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

  12. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    Right now I have these packages pinned, which prevents roundcube from being uninstalled/downgraded (/etc/apt/preferences.d/php-prefer-7):
    Code:
    # this is for howtoforge.com/community/threads/roundcube-1-4-11-and-multiple-php-versions.86397/
    
    # review apt policy for packages which have sury.org candidates pin if the wrong version will be installed
    #     dpkg --list | cut -d' ' -f3 | grep ^php- | xargs apt policy | less
    
    Package: php php-bcmath php-cgi php-cli php-fpm php-gmp php-intl php-json php-mbstring php-mysql php-xml
    Pin: version 2:7.*
    Pin-Priority: 1001
    
    Package: php-common
    Pin: version 2:69
    Pin-Priority: 1001
    
    
    It probably wouldn't hurt to play with uninstalling those pinned meta packages (an others?) and see what other dependency issues turn up (ie. other packages that might need updated like roundcube).
     
  13. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Reply from the Roundcube Debian package maintainer:
    Hi,

    On Thu, 25 Feb 2021 at 18:12:41 +0100, Thom via Pkg-roundcube-maintainers wrote:

    > When installing Roundcube 1.4.11 from the buster-backports repo on Debian 10, it depends on php modules < PHP 8.0.

    See https://salsa.debian.org/roundcube-team/roundcube/-/commit/1add6714e98a3b54b750fca49cf74a11fad050c8 for the rationale.

    > When using the Sury repo, php-cli and others are PHP 8. I do have PHP 7.3 installed with the necessary modules, so I think that a dependency on php7.3-cli, php7.3-intl, etc should be sufficient.

    We're not depending on PHP 7.3, Bullseye has 7.4 and works as well. A fleet of alternatives php7.3-* | php7.4-* isn't an option because it has to be the same version for all modules. Hopefully Roundcube upstream will backport the PHP8 compatibility fixes to 1.4 at some point and we'll be able to remove the restriction then. For now I suppose your best bet is to edit the control file locally if you're using third-party repository with php-* 8.x: https://wiki.debian.org/EditingBinaryPackageMetadata

    Cheers,
    --
    Guilhem.
     
  14. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Just received another email, with good news:

    On second thought this is not ideal since Bullseye will be released with PHP 7.4 and I guess several users will want to upgrade php-* to 8.0 via bookworm or 3rd party repositories.

    After checking with other maintainers what was the best way to express the dependency, I reverted the aforementioned commit and instead added a hint which packages *might* need to be manually installed. The upload should migrate to testing in 10 days and I'll upload a new version to buster-backports then.

    Thank you for bringing that up in time for the hard freeze, would have been more problematic to fix that afterwards :)

    --
    Guilhem.
     
    Last edited: Feb 27, 2021
  15. felan

    felan Member HowtoForge Supporter

    Thom: That is excellent news :D Thanks for the work you've put in to this issue. It is most appreciated!
     
    Th0m likes this.

Share This Page