Issue
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
but nothing works. how can I fix this?
Solution
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
Answered By - Pardeep Answer Checked By - Katrina (WPSolving Volunteer)