How to check if PHP is installed on Ubuntu

If you have not yet read the article on how to get a LAMP stack on your Ubuntu server go read that first to get everything installed.

Install LAMP Server in Ubuntu

This article will test to see if everything is working great.

Now that you have set up your Apache virtual host to point to the new site we will go over how to test if everything now works.

First go to your web directory.

cd /var/www

Then make the newsite directory.

sudo mkdir newsite

Now we need just an index.php page in their.

cd newsite
sudo vim index.php

Now that you have the index page created lets write some PHP.

<?php
phpinfo();

This will call the phpinfo function which will output to the browser everything about the PHP installation. If you get an error or a blank page you did something wrong along the way.

Install LAMP server in Ubuntu

Now that we have our server running we need to install a LAMP stack. Linux, the operating system we will be using. Apache, the web server software we will be running. MySQL, the database we will be using to store our business data. PHP, the web developing language used to develop the website.

First open up your terminal and install tasksel

$ sudo apt-get install tasksel

… and then the LAMP stack:

$ sudo tasksel install lamp-server

Next Article: Ubuntu Apache Virtual Host Setup