昨晚我已将Windows 7更新为Windows 10。
结果是尝试在Windows 7上运行的Windows 10中运行我的本地apache服务器很费劲。我曾尝试卸载并安装其他版本的xampp,然后我不得不更改apache的默认端口以使其运行。
我改变了httpd.conf
从Listen 80
到Listen 1234
与ServerName localhost:80
以ServerName localhost:1234
并在xampp控制面板的Config-> Service and Port Settings中进行设置。我还更改了主端口
现在,我可以使用来访问phpmyadmin localhost:1234/phpmyadmin
。现在我的问题是创建虚拟主机
所以我添加了我的主机(C:\ Windows \ System32 \ drivers \ etc \ hosts)文件
127.0.0.1 sample.local
127.0.0.1 anothersample.local
和我的虚拟主机(D:\ xampp \ apache \ conf \ extra \ httpd-vhosts.conf)文件
<VirtualHost *:1234>
DocumentRoot "D:/xampp/htdocs/sample"
ServerName sample.local
</VirtualHost>
<VirtualHost *:1234>
DocumentRoot "D:/xampp/htdocs/anothersample"
ServerName anothersample.local
</VirtualHost>
我已经重新启动了Apache,但似乎我的虚拟主机无法正常工作。有人可以指出我错过的内容吗?
谢谢@ShamSUP和@maytham-ɯɐɥıλɐɯ我能够通过卸载xampp解决问题。
然后按照此处的说明进行操作
我将在这里列出我已完成的步骤。
appwiz.cpl
和使用打开或关闭Windows功能并通过展开Internet Information Services
-> Web Management Tools
->然后检查来安装IIS管理器控制台IIS Management Console
InetMgr.exe
并输入,然后展开Site
右键单击它,然后单击Edit Bindings
之后,我将安装XAMPP并配置虚拟主机
主机(C:\ Windows \ System32 \ drivers \ etc \ hosts)档案
127.0.0.1 sample.local
127.0.0.1 anothersample.local
虚拟主机(D:\ xampp \ apache \ conf \ extra \ httpd-vhosts.conf)文件
<VirtualHost *:80>
DocumentRoot "D:\xampp\htdocs\sample"
ServerName sample.local
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "D:/xampp/htdocs/anothersample"
ServerName anothersample.local
</VirtualHost>
重启apache和mysql之后,虚拟主机正在运行,希望对以后的人有所帮助。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句