Install LAMP and phpMyAdmin in Ubuntu

Source: Internet
Author: User
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 must first install LAMP Apache, PHP5, and Mysql5. open the terminal and enter the command line. 1. Install Apache1. open the Terminal 2. Enter the following command sudo

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 going out.

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.

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.

Related Article

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.