php环境在本地配置虚拟目录,如配置成www.caixia.com
这样在局域网中就可以直接用www.caixia.com进行访问
也可以用localhost进行访问
 
在F:\APMServ5.2.6\Apache\conf中的httpd.conf下的修改为
#APMServ默认虚拟主机
NameVirtualHost *:80
<VirtualHost *:80>
 ServerName *
 DocumentRoot "F:/WebSite_PHP"  //根目录
<Directory "F:/WebSite_PHP">
 Options FollowSymLinks IncludesNOEXEC Indexes
 DirectoryIndex index.html index.htm default.htm index.php default.php index.cgi default.cgi index.pl default.pl index.shtml
 AllowOverride None
 Order Deny,Allow
 Allow from all
</Directory>
</VirtualHost>
 
 
在F:\APMServ5.2.6\Apache\conf\extra文件夹下的httpd-vhosts.conf下加入
<VirtualHost *>
    ServerName www.caixia.com
    DocumentRoot F:/WebSite_PHP  //为根目录
</VirtualHost>
 
然后在
中点击修改hosts文件,路径为C:\Windows\System32\drivers\etc,在该文件中加入
127.0.0.1       www.caixia.com
 
最后重启apache,ok了