2

I am upgrading a server from Debian 9 (stretch) to Debian 10 (buster), and am aware (and intend) that this results in PHP being upgraded from PHP 7.0 to PHP 7.3.

php -v does indeed show that PHP 7.3 is installed, but when trying to login to the web application running on the server, I get a (vague) error message, and, when I create a test page to run phpinfo, it shows that Apache still seems to be running PHP 7.0.

I had expected that Apache would switch to using PHP 7.3 as part of the OS upgrade. What do I need to do to make Apache now use PHP 7.3?

dave559
  • 349
  • 5
  • 19
  • 1
    Did your upgrade install `libapache2-mod-php7.3`? Did you enable the apache module? – Panki Aug 25 '20 at 14:56
  • I followed the upgrade instructions at https://www.debian.org/releases/buster/amd64/release-notes/ch-upgrading.en.html How can tell if `libapache2-mod-php7.3` is installed, and what do I need to do to enable the module? – dave559 Aug 25 '20 at 15:01
  • 2
    `dpkg -l | grep ^i | grep libapache2-mod-php7.3` will show you. If it doesn't return anything, its not installed. `a2enmod` enables apache modules. – Panki Aug 25 '20 at 15:05
  • 1
    Thank you. It turned out that I had to `a2enmod php7.3` but also `a2dismod php7.0` (and then `systemctl restart apache2`). Feel free to write up as an answer so that I can credit you. – dave559 Aug 25 '20 at 15:10

1 Answers1

5

Proper answer from comments:

The upgrade probably did not install the libapache2-mod-php7.3 package, which is required to integrate php7.3 into apache2.

To check if it is already installed, run

dpkg -l | grep ^i | grep libapache2-mod-php7.3

If this doesn't return anything, it needs to be installed.

apt install libapache2-mod-php7.3

Afterwards, disable the old apache2 module and activate the new:

a2dismod php7.0 && a2enmod php7.3 && systemctl restart apache2
Panki
  • 6,221
  • 2
  • 24
  • 33