PHP environment setup (LAMP) in UbuntuKylin14.04)

Source: Internet
Author: User
1, first open the command line, switch to the root identity, get the latest software package surootsudoapt-getinstallupdate2, install MySQL database sudoapt-getinstallmysql-servermysql-client for the prompt to enter the Database Password, and then press enter, then there is a prompt, repeat the input and press enter to enter the database after installation.

1. First open the command line, switch to the root identity, and obtain the latest software package suroot sudoapt-getinstallupdate 2. Install MySQL database sudoapt-getinstallmysql-servermysql-client to prompt you to enter the Database Password, and press Enter, then there is a prompt, repeat the input again, and then press enter to enter the database after the installation.

1. First open the command line and switch to the root identity to obtain the latest software package.

Su root

Sudo apt-get install update

2. Install the MySQL database

Sudo apt-get install mysql-server mysql-client

Enter the database password for the prompt, press enter, and then press enter again.

After the installation is complete, enter the database to test whether the installation is successful. The welcome information is OK.

Mysql-uroot-p

3. Install the Apache server

Sudo apt-get install apache2

After the installation is complete, test it. Enter http: // localhost/or http: // 127.0.0.1/in the browser/

4. install PHP and enable Apache to support PHP

Sudo apt-get install php5 libapache2-mod-php5

Restart the Apache server after installation.

Sudo/etc/init. d/apache2 restart

Enter in New Terminal

Sudo nautilus

Go to the Apache www folder (in/var by default)

Create a phpinfo. php file

Then write the data in the phpinfo. php file.

 

Enter http: // localhost/phpinfo. php In the browser to view the php information.

However, you cannot connect to the database and the corresponding modules are not installed. Next, let's take a look at step 1.

5. Install the php-mysql package and some other commonly used modules.

Sudo apt-get install php5-mysql php5-curl php5-gd php5-idn php5-imagick php5-imap php5-mcrypt php5-memcache php5-ming php5-ps php5-pspell php5-recode

Then access http: // localhost/phpinfo. php again (you 'd better restart Apache first)

6. Install phpMyAdmin

PhpMyAdmin can be used to conveniently manage our MySQL database.

Sudo apt-get install phpmyadmin

The following options are displayed during installation. If you want to configure phpmyadmin, select "YES"

Enter the MySQL password until the installation is complete.

Because the installation path of phpMyAdmin is/usr/share/phpmyadmin/by default, we move phpmyadmin to the/var/www/directory:

Sudo mv/usr/share/phpmyadmin/var/www

Then, access http: // localhost/phpmyadmin To Go To The phpMyAdmin logon interface.

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.