Thanks to Author:

Tutorial will show you how to set up Apache, PHP and MySQL on your Quantal Quetzal machine so you can get rolling.

Install Apache

First you install Apache, and it’s as easy as it ever was:

Go to Terminal

sudo apt-get install apache2

After a quick install it will come up automatically. Load up a browser and point it http://localhost and you should see this:

This is your bare Apache server.

Install PHP

You’ll want to install the latest version of PHP 5, to do that type:

sudo apt-get install libapache2-mod-php5 php5

This will install PHP5 plus the libraries to interface with Apache.

You’ll want to restart the server

sudo etc/init.d/apache2 restart

To test it out, create a file called test.php:

sudo nano /var/www/test.php

Let’s use the phpinfo() function so we can check out our installation:

/var/www/test.php phpInfo() Documentation
<?php phpinfo(); ?>

It should look like this:

You can inspect your options and if you want to change anything, your php location is here:


Install MySQL

Next you’ll need to install the MySQL server. This is also super easy:

sudo apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql

MySQL will ask you for a password. You really shouldn’t leave this blank, even if it is just going to be on your local machine. It only takes a second to do and some applications will require a password of some type on the server.

Test your server to make sure it’s working properly.

mysql -u root -p
<Enter Password>
show databases;

It should look something like this:

Now you’re up and running!

You may want something to manage your MySQL data, I realize not everyone is as crazy about the prompt as I am. PHPMyAdmin is great:

sudo apt-get install phpmyadmin

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s