ThinkChat🤖让你学习和工作更高效,注册即送10W Token,即刻开启你的AI之旅 广告
>[danger] 本章节说明 针对单独配的PHP环境, 前提: apache 已开启重写模块 >[danger] 打开虚拟主机配置文件 ![](https://img.kancloud.cn/f7/63/f7639758869a6d9bd9f5cd8ef21a0f1c_591x336.png) >[danger] 指向`ThinkPHP` 的public目录 ``` <VirtualHost *:80> DocumentRoot "D:\www\thinkphp\think6.0.1/public" ServerName tp601.cy ServerAlias admin.tp601.cy admin2.tp601.cy <Directory "D:\www\thinkphp\think6.0.1/public"> Options FollowSymLinks ExecCGI AllowOverride All Order allow,deny Allow from all Require all granted </Directory> </VirtualHost> ``` >[danger] host 文件中添加虚拟域名 ``` C:\Windows\System32\drivers\etc\hosts ``` ``` 127.0.0.1 tp601.cy 127.0.0.1 admin.tp601.cy 127.0.0.1 admin2.tp601.cy ``` >[danger] 重启 apache 服务 因为修改了 apache的配置文件(vhosts.conf),所以重启apache才会生效 修改`hosts`不需要重启apache就可以生效,因为`hosts`不是apache的配置文件