Php – Unable to locate package php

installationPHP

I'm installing a LAMP stack on an Ubuntu instance in Google Compute Engine. I'm following the instructions at https://cloud.google.com/community/tutorials/setting-up-lamp
where I'm instructed to enter
sudo apt-get install apache2 php libapache2-mod-php

When I press Enter, I get this message:
Reading package lists… Done
Building dependency tree
Reading state information… Done
E: Unable to locate package php
E: Unable to locate package libapache2-mod-php

Apparently Apache was installed because I can browse the page, but php and libapache2-mod-php are not found. Have the names been changed for these packages?

Best Answer

The ubuntu package is called php7.0

apt-get install php7.0

You may also want to use

apt-get install libapache2-mod-php7.0

In the future, you can check https://packages.ubuntu.com or run

apt-cache search php
Related Topic