Steps for PHP to configure virtual directories under Windows

Source: Internet
Author: User
How PHP configures the virtual directory under Windows

1. First locate the Apache configuration file httpd.conf look for the following code:

# Virtual Hosts
#Include conf/extra/httpd-vhosts.conf

Remove # Include conf/extra/httpd-vhosts.conf #, as follows:

Include conf/extra/httpd-vhosts.conf

Save.

2. Open the httpd-vhosts.conf file under the Extra folder in the Apache conf directory, open it with Notepad, and add the following code at the end:

1 
 
  2ServerName Www.mydemo.
  com
  3DocumentRoot "D:/mydemo"
  4 
  
    
    5
    Options followsymlinks includesnoexec Indexes 
     6 directoryindex index.html index.htm 
    
     default. htm index.php 
     default. PHP index.cgi 
     default. CGI index.pl 
     default. PL index. 
     shtml 
     7 
     allowoverride Options FileInfo 
     8 Order Deny, 
      allow
      9
     
      
  
 
 
  
 
 
  
 
  

    
   
  
   One 
 

3. Then to the C:->WINDOWS->SYSTEM32->DRIVERS->ETC directory, open the Hosts file.
Add the following code at the end:

1 127.0.0.1 www.mydemo.com

And then create the D:\mydemo directory
Then reboot the Apache server.
Look at the browser input www.mydemo.com

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