Table of Contents
php 在windows下配置虚拟目录的方法,php虚拟目录
Home php教程 php手册 php 在windows下配置虚拟目录的方法,php虚拟目录

php 在windows下配置虚拟目录的方法,php虚拟目录

Jun 13, 2016 am 08:55 AM
windowsxp

php 在windows下配置虚拟目录的方法,php虚拟目录

1.先找到apache的配置文件 httpd.conf 找如如下代码:

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

把# Include conf/extra/httpd-vhosts.conf 去掉#号,如下:

Include conf/extra/httpd-vhosts.conf

保存。

2.打开 Apache 的 conf 目录下的  extra 文件夹下的  httpd-vhosts.conf 文件,用记事本打开,在末尾加入以下代码:

<span> 1</span> <VirtualHost *:80>
<span> 2</span> ServerName www.mydemo.<span>com
</span><span> 3</span> DocumentRoot "D:/mydemo"
<span> 4</span> <Directory "D:/mydemo">
<span> 5</span> <span>Options FollowSymLinks IncludesNOEXEC Indexes
</span><span> 6</span> DirectoryIndex index.html index.htm <span>default</span>.htm index.php <span>default</span>.php index.cgi <span>default</span>.cgi index.pl <span>default</span>.pl index.<span>shtml
</span><span> 7</span> <span>AllowOverride Options FileInfo
</span><span> 8</span> Order Deny,<span>Allow
</span><span> 9</span> <span>Allow from all
</span><span>10</span> </Directory>
<span>11</span> </VirtualHost>
Copy after login

3.再到C:->Windows->System32->drivers->etc目录,打开hosts文件。
在末尾添加如下代码:

 1 127.0.0.1 www.mydemo.com 

然后再创建D:\mydemo目录
再然后重启一下apache服务器。
在浏览器输入www.mydemo.com看看

 

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)