gpt4 book ai didi

php - 使用xampp/mysql工作台/

转载 作者:行者123 更新时间:2023-11-30 01:23:52 25 4
gpt4 key购买 nike

我正在尝试重定向到本地主机上的网页,我已经从我的主机文件和 v-hosts 中完成了所有必要的配置,它从我的 C:\Windows\System32\drivers\etc 主机文件中获取我的地址是 name.local 但不显示主页。请记住,该网站具有前端和后端访问权限。我是新人,想在本地处理我的应用程序,然后才能开始在服务器上编辑它。

最佳答案

您发布了此附加评论,其中包含您的虚拟主机定义和主机文件内容

v-host file 
<VirtualHost 127.0.0.1:80>
DocumentRoot "c:/xampp/htdocs/intranet"
ServerName gep.local
ServerAlias gep.local
CustomLog "c:gep.local-access_log" combined
ErrorLog "c:gep.local-error_log"
<Directory "c:/xampp/htdocs/intranet">
DirectoryIndex index.php
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>


host file:
127.0.0.1 gep.local

这里有一些建议:-

您是否重新启动或重新启动 DNS 客户端以激活您的 HOSTS 文件更改。

from a command window run started using 'Run as Administrator' do this
net stop "DNS Client"
then once it reports as STOPPED
net start "DNS Client"

这将刷新 Windows DNS 缓存。 (由于服务名称中有空格,因此需要双引号)

第一次更改<VirtualHost 127.0.0.1:80><VirtualHost *:80>

如果您使用 Apache 2.2.x,您还需要 NameVirtualHost *:80参数作为虚拟主机定义文件中的第一个参数。如果您使用的是 Apache 2.4.x,我相信他们删除了此要求,因此在该版本的 Apache 上没有必要。

所以

new v-host file 

NameVirtualHost *:80

<VirtualHost *:80>
DocumentRoot "c:/xampp/htdocs/intranet"
ServerName gep.local
ServerAlias gep.local
CustomLog "c:/gep.local-access_log" combined
ErrorLog "c:/gep.local-error_log"
<Directory "c:/xampp/htdocs/intranet">
DirectoryIndex index.php
Options Indexes FollowSymLinks
AllowOverride All
Order Allow,Deny
Allow from all
</Directory>
</VirtualHost>

当然,要测试它,请使用地址` http://gep.local ' 在浏览器地址栏中输入这个新的虚拟主机。

关于php - 使用xampp/mysql工作台/,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18227336/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com