Lamp Environment Construction

Source: Internet
Author: User
Tags php development environment

To learn about PhP, we will first build a php development environment. The Linux version is ubuntu14.04.

I. installation and configuration of Apache

1, sudo apt-Get install apache2

Enter the local IP address 127.0.0.1 in Firefox. The default page of apache2 indicates that the installation is successful, as shown in:

The default configuration file for Apache in Ubuntu is/etc/apache2/apache2.conf. The default website root directory is/var/www/html.

2. install PHP

1. sudo apt-Get install PhP5

2, in order to make Apache support PHP, you need to install libapache2-mod-php5 Software Package

Sudo apt-Get install libapache2-mod-php5

3. Restart Apache after installing PHP.

Sudo/etc/init. d/apache2 restart

3. Install MySQL

1. sudo apt-Get install mysql-Server

2, in order to make Apache support MySQL, you need to install libapache2-mod-auth-mysql Software Package

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

3. Install the php5-mysql package

Sudo apt-Get install php5-mysql

4. After installation, enter the following command to verify whether the installation is successful. If the installation succeeds, the MySQL environment is displayed.

Mysql-u root-P

4. Test the PHP Runtime Environment

1. In the root directory/var/www/html/of the website, delete index.html and create an index. php file. Add the following content:

2. Input 127.0.0.1 in Firefox and output the following webpage:

So far, the php development environment has been set up.

 

Lamp Environment Construction

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.