phpstudy虚拟目录的设置

来源:互联网 发布:淘宝信用卡哪个银行好 编辑:程序博客网 时间:2024/05/28 14:57

想要对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 webmaster@dummy-host2.example.com
    DocumentRoot "c:/www/
项目名/public
TP5的入文件目录名"
    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,设置虚拟目录成功

    


原创粉丝点击