Question

Only displays PHP language after LAMP Stack installation

  • Posted October 8, 2014

I did the LAMP Stack Installation and the last step was to create a info.php file with the code

phpinfo();
?>```

That would display my PHP info page. Only displays the language PHP on the browser. How do I get display the PHP result?
Subscribe
Share

Is mod_php installed?

sudo apt-get install libapache2-mod-php5
sudo service apache2 restart

I apologize, I’m using exactly the code you showed me. If it helps, I used this tutorial.

https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu

Is that the exact code you are using? It seems to be missing the <?php at the start of the PHP code. Does this work:

<?php
phpinfo();
?>

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

This question was answered by @kamaln7:

Is mod_php installed?

sudo apt-get install libapache2-mod-php5
sudo service apache2 restart

View the original comment