Ubuntu Apache: "Module php7 does not exist"

74,525

Finally, thanks to the comment of Ed de Almeida, I found the solution.

I had to install an additional package:

$ sudo apt-get install libapache2-mod-php7.0

Now I could run sudo a2enmod php7.0.

Share:
74,525
atorscho
Author by

atorscho

Updated on July 09, 2022

Comments

  • atorscho
    atorscho almost 2 years

    I am trying to upgrade PHP 5.5.9 to PHP 7 on my DigitalOcean Ubuntu 14.04 machine.

    I've read many tutorials and articles how to do it, but each of them misses something. For example, somewhere they say you must sudo a2dismod php5 then sudo a2enmod php7. The problem is that I always get this message

    $ sudo a2enmod php7
    ERROR: Module php7 does not exist!
    

    Does someone one how to resolve this problem, please?

    Thanks in advance.

  • Ed de Almeida
    Ed de Almeida about 8 years
    Good to know that I helped a bit. Congratulations and good development!
  • Suhas.s
    Suhas.s about 7 years
    Thanks Its working
  • otocan
    otocan over 6 years
    Thank you, helped me out. I wonder why this is not included in the php7 package.
  • ZFNerd
    ZFNerd over 6 years
    thanks, should mark as correct answer
  • B.lakshman
    B.lakshman over 6 years
    Thanks, its working
  • giuseppe
    giuseppe about 6 years
    to me this says " Impossible to find package libapache2-mod-php7.0"
  • piepi
    piepi about 6 years
    I am not able to get this to work : E: Package 'libapache2-mod-php7.0' has no installation candidate
  • Synetech
    Synetech almost 6 years
    I already had libapache2-mod-php7.0 installed, but a2enmod complained that ERROR: Module php7.0 does not exist! Removing the mod package and reinstalling fixed the problem.
  • Kapil Verma
    Kapil Verma over 4 years
    Please run following command : sudo update-alternatives --set php /usr/bin/php7.0 Basically that is to change terminal (cli) version