Original address: http://community.linuxmint.com/tutorial/view/486
Installing LAMP (Linux, Apache, MySQL and PHP) on Linux Mint
Through this tutorial, you'll learn how to Install Apache, MySQL and PHP.
If you ' re a webpage designer or developer with PHP, MySQL and Apache, you'll be needing this applications to be instal Led. When I istalled Mint, I am looking for a way to install LAMP and found a tutorial in a website by somebody named "Cargosh IP ". That tutorial is for Ubuntu. But I installed it on my Linux mint, and it is working.
In this guide I'll show you how to install a LAMP system. LAMP stands for Linux, Apache, MySQL, PHP. The guide is intended to help those who have very little of using Linux.
We are not cover you to install Linux the L- AMP, because Linux Mint is already installed in your computer.
Install Apache
To start we install Apache.
1. Open up the Terminal (Applications > Accessories > Terminal).
2. Copy/paste or type the following line of code into Terminal and then press ENTER:
sudo apt-get install apache2
3. The Terminal would then ask for your ' re password, type it and then press ENTER.
Testing Apache
To make sure everything installed correctly we'll now test Apache to ensure it is working properly.
1. Open up any Web browser and then enter the following to the Web address:
http://localhost/
You should a folder entitled apache2-default/. Open it and you'll saying "it works!", Congrats to you! or something like that!
Install PHP
In this part we'll install PHP 5.
Step 1. Again open up the Terminal (Applications > Accessories > Terminal).
Step 2. Copy/paste or type the following line into Terminal and press ENTER:
sudo apt-get install php5 libapache2-mod-php5
Step 3. In the order of PHP to work and is compatible with Apache we must restart Apache. Type the following code in Terminal to does this:
Sudo/etc/init.d/apache2 restart
Test PHP
To ensure there are no issues with PHP let ' s give it a quick test run.
Step 1. In the terminal copy/paste or type the following line:
sudo gedit/var/www/testphp.php
This would open up a file called testphp.php.
Step 2. Copy/paste this line into the Phptest file:
<?php phpinfo ();?>
Step 3. Save and close the file.
Step 4. Now open you ' re Web browser and type the "following into the" Web address:
http://localhost/testphp.php
(It'll show your page that has all information about your PHP.) If you are have prior experience of installing PHP in some other OS, you must have the this page.)
Congrats you have now installed both Apache and php!
Install MySQL
To finish this guide up we'll install MySQL.
Step 1. Once again open up the amazing Terminal and then copy/paste or type this line:
sudo apt-get install Mysql-server
Step 2 (optional). In order for other computers on your network to view the server you have created, you must the ' Bind address '. Begin by opening up Terminal to edit the my.cnf file.
Gksudo gedit/etc/mysql/my.cnf
Change the line
Bind-address = 127.0.0.1
and change the 127.0.0.1 to your IP address.
(In Linux Mint one, terminal itself asked to the set password, But if it doesn ' t follow "step 3.)
Step 3. This is where things may start to get tricky. Begin by typing the following into Terminal:
Mysql-u Root
Following that copy/paste or type this line:
mysql> SET PASSWORD for ' root ' @ ' localhost ' = PASSWORD (' YourPassword ');
(Make sure to change YourPassword to a password of your choice.)
Step 4. We are now going to install a program called phpMyAdmin which are an easy tool to edit your databases. Copy/paste or type the following line into Terminal:
sudo apt-get install libapache2-mod-auth-mysql php5-mysql phpmyadmin
After this is installed we next task is to work with MySQL. To does this we'll need to open a file entitled PHP.ini. To open it type the following:
Gksudo Gedit/etc/php5/apache2/php.ini
Now we are going to have to uncomment the following line by taking out the semicolon (;).
Change this line:
; extension=mysql.so
To look like this:
Extension=mysql.so
Now just restart Apache and your are all set!
Sudo/etc/init.d/apache2 restart
If you get a 404 error upon visiting Http://localhost/phpmyadmin:You'll need to configure apache2.conf to work with PHP MyAdmin.
sudo gedit/etc/apache2/apache2.conf
Include the following line at the bottom of the file, save and quit.
Include/etc/phpmyadmin/apache.conf
Then just restart Apache
Sudo/etc/init.d/apache2 restart
Now make wonderful website and have fun!
Terminal scares the newbies, but here, you'll have a magical Terminal or comand promt (whatever you call it) are.
And as Linux is very secure OS, it's ll ask you the password again and again, on every administrative command. Your ' ll have to type in your passwo