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?

4
  • 1
    Did your upgrade install libapache2-mod-php7.3? Did you enable the apache module?
    – Panki
    CommentedAug 25, 2020 at 14:56
  • I followed the upgrade instructions at debian.org/releases/buster/amd64/release-notes/… How can tell if libapache2-mod-php7.3 is installed, and what do I need to do to enable the module?
    – dave559
    CommentedAug 25, 2020 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
    CommentedAug 25, 2020 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
    CommentedAug 25, 2020 at 15:10

1 Answer 1

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 

    You must log in to answer this question.

    Start asking to get answers

    Find the answer to your question by asking.

    Ask question

    Explore related questions

    See similar questions with these tags.