phpstudy虚拟目录的设置

想要对phpstudy进行虚拟目录设置,只需要修改三个地方即可,分别是:

1、找到C:\Windows\System32\drivers\etc下的hosts文件的最末尾加上以下内容:

127.0.0.1  www.xxx.com(此处输入访问项目时的网址)

2、打开Apache,找到httpd.conf打开,Ctrl+f输入include conf 查找到Include conf/extra/httpd-vhosts.conf将Include conf/extra/httpd-vhosts.conf前面的#去除

3、打开Apache,找到apache/conf/extra的httpd-vhosts.conf打开,输入以下内容:

<VirtualHost *:80>
    ServerAdmin [email protected]
    DocumentRoot "c:/www/项目名/publicTP5的入文件目录名"
    ServerName www.xxx.com与C:\Windows\System32\drivers\etc下的hosts文件下写入的地址一样
    ErrorLog "logs/dummy-host2.example.com-error.log"
    CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>  

4、重启phpstudy,设置虚拟目录成功

猜你喜欢

转载自blog.csdn.net/a8240357/article/details/82289145