1

Background:

I have a Debian container that installs libapache2-mod-php and is running PHP 7.2 server. It has been set up half a year ago and is running fine.


Problem:

This week I've been trying to install the Debian containers on another VM with the same OS.

It seems like this package has gotten an update recently (defaults to 7.3) which breaks my PHP 7.2 server after the installation.


Attempts:

I've tried apt policy libapache2-mod-php, it shows both environments contains the same origins, but both libapache2-mod-phps' versions of the same origin are different.

I am really confused as in how to specify apt to install PHP 7.2 when there's no available version on apt policy?


Broken Container:

root@b3ec62f3096d:/srv/server/server# apt policy libapache2-mod-php
libapache2-mod-php:
  Installed: 2:7.3+69+0~20190303094804.15+stretch~1.gbp0f7465
  Candidate: 2:7.3+69+0~20190303094804.15+stretch~1.gbp0f7465
  Version table:
 *** 2:7.3+69+0~20190303094804.15+stretch~1.gbp0f7465 500
        500 https://packages.sury.org/php stretch/main amd64 Packages
        100 /var/lib/dpkg/status
     1:7.0+49 500
        500 http://deb.debian.org/debian stretch/main amd64 Packages

Working Container:

root@430822ee576a:/srv/server/server# apt policy libapache2-mod-php
libapache2-mod-php:
  Installed: 1:7.2+65+0~20181014094036.7+stretch~1.gbpaaf4ee
  Candidate: 1:7.2+65+0~20181014094036.7+stretch~1.gbpaaf4ee
  Version table:
 *** 1:7.2+65+0~20181014094036.7+stretch~1.gbpaaf4ee 500
        500 https://packages.sury.org/php stretch/main amd64 Packages
        100 /var/lib/dpkg/status
     1:7.0+49 500
        500 http://deb.debian.org/debian stretch/main amd64 Packages
0

The broken container is really your “working container”, in a dead-man-walking fashion: its repository caches are outdated, so apt policy is telling you something which was true in the past but no longer is. If you run apt update in it, you’ll see the same situation as in your “broken container”.

If you really need PHP 7.2, you need to install the corresponding package instead of the libapache2-mod-php package, which will always pull in the latest stable PHP version. Installing libapache2-mod-php7.2 should fix your issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.