Good blog: http://blog.csdn.net/guaikai/article/details/6905781
1: First install Apache: Open Terminal (ctrl+alt+t),
Input command: sudo apt-get install apache2 can be installed,
After the installation, open the browser, enter in the address bar: localhost or http://127.0.0.1
See it works to show that the installation was successful!
Default root directory:/var/www/
2: Install MySQL:
sudo apt-get install mysql-server-5.0
After the installation, you will need to set up a new MySQL root password, enter your own password after enter key, and then confirm the password.
3: Install PHP 5 and Apache PHP 5 module:
sudo apt-get install php5 libapache2-mod-php5
Sudo/etc/init.d/apache2 Restart (restart Apache)
Try success No:
Command: Gksudo gedit/var/www/text.php "Create a text.php file under the Apache default root directory/var/www/"
Verify that the installation was successful by entering the following code in the text.php file:
<?php
echo "HelloWorld";
?>
Enter in the browser address bar: http://localhost/text.php If the page displays HelloWorld it is successful
Tip: If you cannot enter the command again when you return to the terminal, press CTRL + Z key combination
4: Let Apache and PHP support PHP:
sudo apt-get install Libapache2-mod-auth-mysql
sudo apt-get install Php5-mysql
Sudo/etc/init.d/apache2 Restart (restart Apache)
The environment has been built!
/var/www/(apache2 Web file is here)
/var/lib/mysql (MySQL file put here)
If you want to connect remotely, also install SSH, command: sudo apt-get install SSH
Maybe we're still used to phpmyadmin.
5: Install phpMyAdmin
sudo apt-get install phpMyAdmin
At this point on the browser input: Http://localhost/phpmyadmin found not found
So we have to move the installation to the phpMyAdmin folder to/var/www/below.
sudo ln-s/usr/share/phpmyadmin//var/www/
Execute the above to command, we have moved the phpMyAdmin folder to the destination, or you can copy the phpMyAdmin directly under the/var/www/folder.
We again entered on the browser: http://localhost/phpmyadmin return When we found the familiar interface back
Ubuntu under Install Apache2, php5 MySQL