PHPStudy virtual host configuration steps

1, first open PHPStudy server window displays a successful start to

2, click on "Other Options menu" -------- "open the configuration file ------" vhosts-conf points to open

3, then add your domain name information fill out save close

<VirtualHost *: 80>
DocumentRoot "D: \ Study \ the Test"  // destination folder
ServerName www.study.cn  // your domain name
ServerAlias www.study.cn  // your domain name
<Directory "D: \ PHPlhj \ the Test "> // Destination folder
Options FollowSymLinks ExecCGI
AllowOverride All
the Order the allow, deny
the Allow from All
the Require All granted
</ Directory>
</ VirtualHost>

On top of a relatively simple operation can also try the following

NameVirtualHost *:80
<VirtualHost *:80>
ServerName www.study.com  //你的域名
DocumentRoot "d:/PHPStudy/http/" //目标文件夹
<Directory "d:/phplhj/http/">  //目标文件夹
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 Options FileInfo
Order Deny,Allow
Allow from all
</Directory>
</VirtualHost>

 4,点击 “其他选项菜单” --------》打开配置文件------》http-conf 点开

5,之后点击ctar+F搜索一下 vhosts 删除前面的#

6,然后按照路径在电脑找到hosus文件 然后打开

7,把你的域名写上去即可、

域名按照格式写入然后保存关闭 

重启PHPStudy即可

 

注意:若无法对hosts文件进行修改,请右击hosts,选择属性,安全,把所有用户的权限都勾选即可修改。

 

 

 

Guess you like

Origin www.cnblogs.com/xiaojiji/p/11228120.html