Install lamp and phpMyAdmin in Ubuntu

Source: Internet
Author: User
Document directory
  • 1. install Apache
  • 2. Test Apache
  • 3. Install PhP5
  • 4. Test PHP
  • 5. Install MySQL

The lamp configuration in Ubuntu has become a heart disease for some people. With the phpMyAdmin configuration, they even do not know it. Now I will share some of my experiences on lamp and phpMyAdmin configuration in Linux. Hope to help you.

We need to install lamp in Apache, PhP5, and mysql5.

Open the terminal and enter the command line.

1. install Apache

1. Open the terminal

2. Enter the following command

Sudo apt-Get install apache2

3. If you do not have sudo permission, enter the password.

2. Test Apache

To determine whether the installation is successful, let's test it.

1. Open your browser and enter the following URL

Http: // localhost/

If it succeeds, you will see the following content: "It works !" Congratulations! The first step is that you are on the move.

3. Install PhP5

Step 1. Open the terminal (CTRL + ALT + T).

Step 2. Enter the following command line:

Sudo apt-Get install PhP5 libapache2-mod-php5

Step 3. To make PHP and Apache work together, we need to configure PHP and test it.

Sudo/etc/init. d/apache2 restart

4. Test PHP

Step 1. Create a PHP test file (phptest. php) and enter the following content:

Sudo gedit/var/www/testphp. php

Step 2. We will open a text editor and enter the following content in it.

<? PHP phpinfo ();?>

Step 3. Save and exit.

Step 4. Open the browser and check the content we just created. Enter the following URL.

Http: // localhost/testphp. php

If the PHP information page is displayed, it means that you have succeeded in a small step. 5. Install MySQL

Next we will install mysql5 (this is the last step, which is also a more troublesome step. Pay attention to it during installation .)

Step 1. Open the terminal again and enter the following content.

Sudo apt-Get install mysql-Server

Step 2. During installation, enter the MySQL password if required. If no requirements are required, perform the next step. Enter the following command in the terminal.

Mysql-u Root

Later, you need to enter the following content;

Mysql> set password for 'root' @ 'localhost' = PASSWORD ('yourpassword ');

The above 'root' is your MySQL user name, And 'yourpassword' is your new password.

Step 3. next we will deal with the more difficult phpMyAdmin. The common problem here is that phpMyAdmin is installed but the management interface is not displayed when http: // localhost/phpMyAdmin is entered, the page is not found. Don't worry. We have installed phpMyAdmin first and then solved it. Enter the following command:

Sudo apt-Get install libapache2-mod-auth-mysql php5-mysql phpMyAdmin

PhpMyAdmin here works with the PhP5 we installed earlier. If the PHP and phpMyAdmin you installed do not match, they will not work.

Step 4. Now let's solve the problem of "not working" phpMyAdmin. After installing phpMyAdmin, do not think everything is ready. In fact, we have another task to complete, that is, to configure phpMyAdmin and apache2. For the same terminal, enter:

CP/etc/PHPmyAdmin/Apache. CONF/etc/apache2/sites-available/phpMyAdmin

In this way, copy Apache. conf (Apache configuration file) in phpMyAdmin to the phpMyAdmin file under apache2/sites-available.

Step 5. Enter the following information to go to the sites-enabled Folder:

CD/etc/apache2/sites-enabled/

Step 6. After Entering, we need to establish a link to the configuration file so that we can use it. Input:

Sudo ln-S ../sites-available/phpMyAdmin

Step 7. Restart apache2

Sudo/etc/init. d/apache2 restart

Okay. Open http: // localhost/phpMyAdmin and try it out.

So far, our lamp configuration has completely ended, and I hope it will help you.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.