Configure the apache + php + mysql development environment in windows

Source: Internet
Author: User
Tags website domain names

This article will introduce to you how to quickly build a local apache + php + mysql development environment for windows, and how to access multiple website domain names.

Required Software: XAMPP 2.5

After downloading the installation, we recommend that you change the installation directory to a disk other than drive C (the default site directory and mysql data are in the installation directory)

I am installing it on drive D (D:/xampp)

After installation, open and start the apache and mysql services.

Enter http: // localhost in the browser and you will see It Works without accident. Congratulations! The installation is successful.

The above is a float cloud, and the following is the focus:

1. Check whether apache has enabled the VM.

Open D:/xampp/apache/conf/httpd. conf

Locate Include "conf/extra/httpd-vhosts.conf" and confirm that the previous # has been removed

2. Set multiple virtual hosts

Open D:/xampp/apache/conf/extra/httpd-vhosts.conf

Find NameVirtualHost *: 80. Check that the previous one is removed. Otherwise, remove it #

Copy the following code to the last line.

The Code is as follows: Copy code
<VirtualHost *: 80>
# ServerAdmin postmaster@dummy-host2.localhost
DocumentRoot "/xampp/htdocs/develop"
ServerName develop.rin.com
# ServerAlias www.dummy-host2.localhost
# ErrorLog "logs/dummy-host2.localhost-error.log"
# CustomLog "logs/dummy-host2.localhost-access.log" combined
</VirtualHost>

If you want to open another Vm, copy it to the last line, for example:

The Code is as follows: Copy code
<VirtualHost *: 80>
# ServerAdmin postmaster@dummy-host2.localhost
DocumentRoot "/xampp/htdocs/develop2"
ServerName develop2.rin.com
# ServerAlias www.dummy-host2.localhost
# ErrorLog "logs/dummy-host2.localhost-error.log"
# CustomLog "logs/dummy-host2.localhost-access.log" combined
</VirtualHost>

Remember to save.

3.create a site directory in the tracking directory and add it to index.html (for testing)

Create D:/xampp/htdocs/develop

Create D:/xampp/htdocs/develop2

Into index.html (for testing)

4. Modify the host file (for domain name resolution)

Open C:/Windows/System32/drivers/etc/hosts (Open notepad)

Add the following two lines:

The Code is as follows: Copy code

127.0.0.1 develop.rin.com

127.0.0.1 develop2.rin.com

5. Restart apache

Configuration ends so far

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.