Thanks to Author:

http://www.jeremymorgan.com/tutorials/linux/how-to-install-apache-php-and-mysql-on-ubuntu-12-dot-10-quantal-quetzal/

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

1
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:

1
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

1
sudo etc/init.d/apache2 restart

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

1
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
1
<?php phpinfo(); ?>

It should look like this:

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

1
/etc/php5/apache2/php.ini

Install MySQL

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

1
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.

1
2
3
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:

1
sudo apt-get install phpmyadmin
Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s