2

I have different versions of Php 7.0, 7.2, 7.3 installed on ubuntu 16.04.

In terminal if I type php -v, it shows like

PHP 7.3.6-1+ubuntu16.04.1+deb.sury.org+1 (cli) (built: May 31 2019 11:06:26) ( NTS )

But in my localhost url, on printing phpinfo()

PHP Version 7.0.33-8+ubuntu16.04.1+deb.sury.org+1

When I try to switch to v-7.3 using sudo a2enmod php7.3 it gives error

ERROR: Module php7.3 does not exist!

I checked with ls /etc/apache2/mods-enabled/php*, it gives like

/etc/apache2/mods-enabled/php7.0.conf /etc/apache2/mods-enabled/php7.0.load

Then I tried to install apache2 module for php 7.3 like

sudo apt-get install libapache2-mod-php7.3 

it gives

libapache2-mod-php7.3 is already the newest version (7.3.6-1+ubuntu16.04.1+deb.sury.org+1)

Any hints what could be wrong here.

I used below ref

https://askubuntu.com/questions/912638/error-module-php7-0-does-not-exist Ubuntu Apache: "Module php7 does not exist"

EDIT:

If I run sudo apt purge libapache2-mod-php7.3

Err:1 http://ppa.launchpad.net/ondrej/php/ubuntu xenial/main amd64 php7.3-fpm amd64 7.3.6-1+ubuntu16.04.1+deb.sury.org+1 403 Forbidden E: Failed to fetch http://ppa.launchpad.net/ondrej/php/ubuntu/pool/main/p/php7.3/php7.3-fpm_7.3.6-1+ubuntu16.04.1+deb.sury.org+1_amd64.deb 403 Forbidden E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

Hiranya Sarma
  • 1,454
  • 4
  • 15
  • 25
  • Exists the module? Check it with `ls /etc/apache2/mods-available/php*` – CodyKL Jun 26 '19 at 07:49
  • it gives `/etc/apache2/mods-available/php7.0.conf /etc/apache2/mods-available/php7.0.load` – Hiranya Sarma Jun 26 '19 at 07:51
  • Run `sudo apt purge libapache2-mod-php7.3` and then `sudo apt install libapache2-mod-php7.3`. Then check again if the mod appears in the folder, if it appears then, run the `sudo a2enmod ...` command followed by `sudo service apache2 restart` – CodyKL Jun 26 '19 at 07:56
  • for 1st command got issues, pls see my edit – Hiranya Sarma Jun 26 '19 at 08:02

0 Answers0