MorshedSaif
MorshedSaif

Reputation: 399

lamp stack is not working properly in linux mint

I am a newbie to Linux. I was trying to install lamp stack in linux-mint. I used this command sudo apt-get install apache2, and looks like this is working. I enter the localhost in my browser and it shows the apache2 ubuntu default page. but the problem is when I create a info.php file in /var/www/html this directory with some basic PHP code <?php phpinfo(); ?>, instead of showing PHP details and versions, it is showing me the the raw PHP code in the browser <?php phpinfo(); ?>. I've tried some solution from StackOverflow enter image description here

but nothing works. how can I fix this?

Upvotes: 0

Views: 717

Answers (1)

Pardeep
Pardeep

Reputation: 2283

You did not have PHP installed or maybe your php is not enable.

you can do:

For install -> sudo apt-get install php php-mysql

For enable ->

sudo a2enmod php7  
sudo service apache2 restart

this is important sudo service apache2 restart

Upvotes: 2

Related Questions