Setting up a lamp (linux+apache+mysql+php) development environment under Ubuntu

Source: Internet
Author: User

Lamp is a very popular word in the industry, and these 4 letters represent Linux,apache,mysql and PHP respectively. Lamp with its efficient and flexible characteristics has become the first choice for small and medium enterprises.

Previously introduced a way to quickly build lamp.


1 Open terminal on Ubuntu, enter

sudo apt-get install apache2 php5-mysql libapache2-mod-php5 mysql-server

One breath to download (apache2,php5,mysql) three tools


2 install MySQL, will let you set a root administrator's password, enter 2 times, select OK


3 安装完成以后打开浏览器输入,localhost或者127.0.0.1,回车

It Works will appear and the installation is successful


4 Create a PHP test file my.php, stored in the Apache home directory location, the home directory location can be set in the file (/etc/apache2/sites-enabled/000-default.conf),


My home directory is/homt/timothy/workspace/web.

sudo touch /home/timothy/workspace/web/my.php

sudo gedit/home/timothy/workspace/web/my.php

写入 

<?php

Phpinfo ();

?>

Save



5 Visit http://localhost/test.php or http://127.0.0.1/test.php



If you appear on the page

Forbidden

You don ' t have permission to access

, you can view the apache2.conf file

sudo gedit/etc/apache2/apache2.conf

Make sure the configuration is correct

<Directory/home/timothy/workspace/web>
Options FollowSymLinks
AllowOverride None
</Directory>

Related Article

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.