1

I am new to LAMP in my Ubuntu 15.04. I just installed the LAMP stack and to get my php info, I made testphp.php which has the following code...

<?php
phpinfo();
?>

I placed the file in /var/www/html .

The http://localhost is working fine but not the testphp.php .

I tried to access the testphp.php by going to http://localhost/testphp.php but my output is simply the code in the testphp.php and not the php informtion.

So as far as I have realised, php is not properly configured with the apache server.

Either ways, how do i solve this?

3
  • Can you run command "ls /etc/apache2/mods-enabled/" and look if you see there php5.conf and php5.load, if not use command sudo a2enmode php5
    – Mike
    Jul 11, 2015 at 16:03
  • @Mike , I see both of them. Now? Jul 11, 2015 at 16:09
  • Have a look at this stackoverflow.com/questions/5121495/…
    – Mike
    Jul 11, 2015 at 16:59

2 Answers 2

1
sudo apt-get install lamp-server^

When used, it will attempt to install all of the features and configuration for LAMP. It will know and skip anything that is already there so do not worry about any overwriting of your configuration.

0
sudo apt-get purge php5
sudo apt-get install php5
sudo service apache2 restart

I recently had the same issue with a lamp stack. At the end of it all I had to do was reinstall php5 and restart apache and it all started working with no issues.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .