PHP Learning Record First: installation of lamp under Ubuntu1404

Source: Internet
Author: User
Tags learn php
Recent time will learn PHP full stack development, will write a series of articles to summarize the process of learning to encourage each other.

The first article records the installation of the lamp environment

0. Install Apache Web server

Update the system before installing

sudo apt-get update && sudo apt-get Dist-upgrade

Then install Apache

sudo apt-get Install Apache2

At this point in the browser to enter localhost can see "It works!", indicating that the installation was successful.

1. Install MySQL Database

sudo apt-get install Mysql-server Php5-mysql

Then there are some security settings, including root password, Telnet, and so on.

sudo mysql_secure_installation

If you choose to have y/n, it's OK.

2. Install PHP

Install PHP5 and some useful extensions (Php5-curl,php5-imagick, etc.):

sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt php5-curl php5-imagick php5-cli

Modify the Apache dir.cof file to allow Apache to prioritize the search for index.php:

 
  
  
       DirectoryIndex index.php index.html index.cgi index.pl index.xhtml index.htm
 
  

Then restart Apache Web server:

sudo service apache2 restart

3, modify the root directory of the site

Two configuration files need to be modified

1) Modify/etc/apache2/apache2.conf,找到 ,将/var/www/替换为自己的目录

2) Modify/etc/apache2/sites-available/000-default.conf,找到DocumentRoot /var/www/html,将/var/www/html替换为自己的目录

Then restart Apache.

sudo service apache2 restart

3) Copy the "index.html" file to your own root directory

CP/var/www/html/index.html/own root directory

4. Summary

At this point, the lamp environment is installed, in the future you can develop their own website.

Reference Links:

[1] zh cheese: Ubuntu 14.04 installation lamp (linux,apache,mysql,php)

[2] Ubuntu 14.04 installs Apache

The above on the introduction of the first PHP learning record: Ubuntu1404 lamp installation, including the aspects of the content, I hope that the PHP tutorial interested in a friend helpful.

  • 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.