My case was a little different. I upgraded from Ubuntu 19.04 to 19.10. While upgration it installed php 7.3 (where as php 7.2 was already installed). With 2 versions installed a2query -m php7.3 return No module matches php7.3.
Solution I found was from how-to-install-php-7-3-on-ubuntu.
To set PHP 7.0 as the default, run
update-alternatives --set php /usr/bin/php7.0
To set PHP 7.2 as the default, run
update-alternatives --set php /usr/bin/php7.2
To set PHP 7.3 as the default, run
update-alternatives --set php /usr/bin/php7.3
Before we can configure Apache to use PHP 7.3, we need to disable the old version of PHP 7.0 by typing
a2dismod php7.2
Now enable the newly installed PHP 7.3 version with the following command:
a2enmod php7.3
Restart the Apache web server for the changes to take effect:
sudo systemctl restart apache2
a2enmod
than to copy the file manually between mods-available and mods-enabled.a2enmod
creates a symlink and so you'll only have one copy of the configuration. – jkt123 Apr 21 '14 at 02:17apt-get install libapache2-mod-php
,a2query -m php7.0
,service apache2 restart
– marlo Jun 09 '16 at 10:24libapache2-mod-php7.0
, so output ofa2query -m php7.0
was empty... – 7ochem Mar 20 '17 at 20:54libapache2-mod-php
&php
then enablesudo a2enmod php7.3
. – Ibrahim.H Jul 25 '21 at 14:55