Install and configure LAMP in Ubuntu to test PHP locally

Source: Internet
Author: User
Tags php development environment
The blog reposted from Zhike-zxdker recently changed my main operating system to Ubuntu. I feel that Linux can better support php than windows, and install and test wordpress templates and plug-ins locally, it is much more convenient than remote virtual hosts. I recently used my winter vacation time to study php. As a pseudo-tech man studying science, I usually don't have much time to spend. It is good to take a long vacation. Let's talk about how to set up the LAMP php development environment (Linux-Apache-MySQL-PHP. First

Reprinted fromZhike-zxdkerBlog

Recently, my main operating system has changed to Ubuntu. I feel that Linux supports php BETTER THAN windows. Installing and testing wordpress templates and plug-ins locally is much easier than remote virtual hosts. I recently used my winter vacation time to study php. As a pseudo-tech man studying science, I usually don't have much time to spend. It is good to take a long vacation. Let's talk about how to set up the LAMP php development environment (Linux-Apache-MySQL-PHP.

First, install the LAMP kit, set the settings correctly, and finally install the php IDE.

1. Install the LAMP package in Ubuntu.

There are many ways to solve the same problem in Ubuntu. I am a cainiao, so I chose the simplest method.

Enter

Sudo tasksel

Then a software package interface will appear, move the cursor to the LAMP server, press the space, and then select this item. Other items can be deselected, and click OK. Next, you will be asked to enter the password of the root user of MySQL. Remember to use it later when installing the php program. Then install LAMP, which is simple. Enter http: // 127.0.0.1 in the browser and test apache2.

It works!

This is the default web page for this server.

The web server software is running but no content has been added, yet.

It indicates that apache2 has been installed. You can also test MySQL and PHP5. I will not explain how to test it here. Generally, the webpage root directory is under/var/www. Some friends may encounter a situation where they cannot parse php correctly. when they enter the home page, they will prompt whether to download and save the php file. In this way, you can restart apache first.

Sudo/etc/init. d/apache2 restart

Use

Sudo apt-get install libapache2-mod-php5

Sudo/etc/init. d/apache2 restart

Sudo a2enmod php5

It is used to install this module and restart apache to solve the problem.

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.