Installing lamp and phpMyAdmin on Ubuntu

Source: Internet
Author: User
Installing lamp and phpMyAdmin under Ubuntu

Installing lamp and phpMyAdmin under Ubuntu

About the lamp configuration under Ubuntu, has become some people's heart disease, plus phpmyadmin configuration, but also make them selves here. Now I'm going to share some of my experience with Linux on configuring lamp and phpMyAdmin. I hope you have some help.

We first need to install lamp is APACHE,PHP5,MYSQL5.

Open the terminal and enter the command line.

1. Installing Apache

1. Open the terminal

2. Enter the following command

sudo apt-get install apache2

3. If you do not have sudo permissions, you need to enter a password.

2. Test Apache

To determine if the installation was successful, let's test it.

1. Open the browser and enter the following URL

http://localhost/

If successful, you will see the following "It works!", congratulations, first step, you sort of stepped out.

3. Installing PHP5

Step 1. Open Terminal (ctrl+alt+t).

Step 2. Enter the following command line:

sudo apt-get install php5 libapache2-mod-php5

Step 3. In order for PHP and Apache to work together, we need to configure PHP and test it.

Sudo/etc/init.d/apache2 restart

4. Test PHP

Step 1. We'll build a PHP test file (we call it phptest.php) and enter the following:

sudo gedit/var/www/testphp.php

Step 2. At this point we will open a text editor and enter the following content.

Step 3. Save exit.

Step 4. Now open the browser and look at what we just created. Enter the following URL.

http://localhost/testphp.php

If you show PHP's information content page, you have another small step.



5. Install MySQL

Let's install the MYSQL5 (this is the last step, but also a more troublesome step, the installation time attention. )

Step 1. To open the terminal again, enter the following content.

sudo apt-get install Mysql-server

Step 2. If you are asked to enter a MySQL password during installation, enter the password. If there is no requirement, perform the next step. Enter the following command in the terminal.

Mysql-u Root

Later, you have to enter the following content;

mysql> SET PASSWORD for ' root ' @ ' localhost ' = PASSWORD (' YourPassword ');

The above ' root ' is your MySQL username, ' YourPassword ' is your new password.

Step 3 below we will deal with the more difficult phpmyadmin here is often the problem is clearly installed phpmyadmin but in the input http://localhost/phpmyadmin when the management interface does not appear, Instead, there are no pages found. No hurry, we first install again phpMyAdmin and then to solve. Enter the following command:

sudo apt-get install libapache2-mod-auth-mysql php5-mysql phpmyadmin

The phpMyAdmin here is in line with the php5 that we have previously installed, and if you load PHP and phpMyAdmin do not match, they will not work.

Step 4. Now we are going to solve the problem of phpMyAdmin "not working", when we have installed phpMyAdmin, don't think everything is ready. In fact, we have a job to complete, is to configure phpMyAdmin and apache2. For the same terminal, enter:

Cp/etc/phpmyadmin/apache.conf/etc/apache2/sites-available/phpmyadmin

This allows us to copy the apache.conf (Apache configuration file) from phpMyAdmin to the phpMyAdmin file under Apache2/sites-available.

Step 5. Then enter it into the Sites-enabled folder:

cd/etc/apache2/sites-enabled/

Step 6. After entering, we will create a link to the configuration file so that it can be used. Input:

sudo ln-s. /sites-available/phpmyadmin

Step 7: Restart Apache2

Sudo/etc/init.d/apache2 restart

All right. Open the http://localhost/phpmyadmin to experience it.

So far, our lamp configuration is completely over and we hope to 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.