Do you want to work or play with LAMP (Linux, Apache, MySQL, PHP), using phpMyAdmin on Ubuntu 14.04 LTS?  Me too!  And so I Googled for a single web source on how to make this techie playground happen.  My findings varied.  While there’s plenty of good information online, it’s scattered about like pieces to a puzzle, and finding the information was either incomplete or unnecessarily complicated.  Here are my notes compiled, which I’ve tailored, streamlined and applied successfully.

This is the big picture with all the information in one place.  It will be quick, easy and painless.  Here’s an overview of the steps involved:

  1. Install the LAMP server
  2. Install phpMyAdmin and test Apache and phpMyAdmin
  3. Set WWW folder permissions
  4. Test PHP

#1. Installing LAMP

Open your Ubuntu Terminal (Ctrl+Alt+T) and copy and paste the following:

sudo apt-get install tasksel -y && sudo apt-get update && sudo tasksel

01 Sw select lamp server

Click to enlarge.

Use down arrow key to navigate to the LAMP option, then select it by using the space key, select the Tab key to highlight the <OK> option and select your Enter key to proceed.

Click to enlarge.

Click to enlarge.

Click to enlarge.

Click to enlarge.

Enter a password you will remember, then select Enter key.

Click to enlarge.

Click to enlarge.

And repeat, entering the same password as on the previous screen.

Click to enlarge.

Click to enlarge.

Once installed, the previous window will close and you will be returned to the Terminal.


#2. Installing phpMyAdmin

Enter the following commands into the terminal:

sudo apt-get update && sudo apt-get install phpmyadmin -y

Click to enlarge.

Click to enlarge.

Use down arrow key to navigate to the apache2 option, then select it by using the space key, select the Tab key to highlight the <OK> option and select your Enter key to proceed.

Click to enlarge.

Click to enlarge.

Next window appears, asking to configure database for phpmyadmin with dbconfig-common.  Yes is already highlighted, simply select the Enter key to proceed.

Click to enlarge.

Click to enlarge.

Type a password you will remember for the database’s administrative user, then select the Enter key to proceed.

Click to enlarge.

Click to enlarge.

Simply re-enter the password you used on the previous screen, when asked to enter MySQL application password for phpmyadmin, then select the Enter key to proceed.

Click to enlarge.

Click to enlarge.

Simply re-enter the password you used on the previous screen, when asked to enter MySQL application password for password confirmation, then select the Enter key to proceed.

Once installed, the previous window will close and you will be returned to the Terminal, where you will copy and paste the following command and select your Enter key:

sudo apt-get install php5-mcrypt && sudo php5enmod mcrypt && sudo service apache2 restart

You can now test the following by clicking the links:

Test Apache:  When clicking this link you should see this image below.

Click to enlarge.

Click to enlarge.

Test phpMyAdmin When clicking this link you should see this image below.

Click to enlarge.

Login with the root username and your password used when setting up your phpMyAdmin installation.  Once logged in, you will see the phpMyAdmin interface shown below.

Click to enlarge.

Click to enlarge.


 #3. Set WWW Folder Permissions

To set the WWW folder permission, allowing you to modify the /www/html/ directories and files, where your web content will go, copy and paste the following command in your Terminal window, replacing username with your Ubuntu login name:

sudo chown -R username /var/www

You can locate this by navigating to the Home folder, Computer, var/www/html.  Once there, you’ll see you can add and modify content, like WordPress files, etc.

Click to enlarge.

Click to enlarge.


#4. Test PHP

You will need to create a simple PHP file using your Gedit text editor program (right-click on the desktop, select New Document, then Empty Document:

  1. Name the file: phpinfo.php
  2. Open the file and copy and paste this information exactly as you see here:

<?php
// Show all information, defaults to INFO_ALL
phpinfo();
?>

  1. Save and close the phpinfo.php file
  2. Move this file to the /www/html directory
  3. Click this web address here: http://localhost/phpinfo.php
  4. You should then see the page image below appear when successful:
Click to enlarge.

Click to enlarge.

Congratulations!  You have now installed LAMP, phpMyAdmin and set your WWW folder permissions and are ready to begin local web and database development on your Ubuntu 14.04 operating system.  Feel free to contact me with any questions.

Enjoy!