I install Ubuntu server 16.04 in VPS, after install I need to install PHP and Apache.

For PHP 7.0:

sudo apt-get install php7.0 

For Apache:

sudo apt-get install apache2

But after install, in browser PHP codes show.

Do I need to change the apache2 setup to allow php?


It seems according to this that you need to install php7 apache-module

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

Then restart apache

sudo service apache2 restart


sudo systemctl restart apache2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.