Install LAMP and phpmyadmin on Ubuntu

Source: Internet
Author: User
Install LAMP and phpmyadminUbuntu in Ubuntu and install LAMP and phpmyadmin on 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 install LAMP and phpmyadmin on Ubuntu for LAMP and phpmyadmin in LINUX.
Install LAMP and phpmyadmin in Ubuntu

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.