如何通过点对点网络使用 HTTP 访问 PHP 文件?
我使用跳线(5E 类)连接了两台 PC(例如 PC1 和 PC2),两台 PC 都运行 Windows 7。PC1 和 PC2 的 IP 地址分别为 192.168.1.2 和 192.168.1.3。我已经成功为两台计算机配置了家庭组,并且简单的文件共享没有问题。
我应该知道的是,已经安装了WAMPServer并在PC1的根目录中存储了一些PHP文件,我如何从PC2访问它们?我尝试在 PC2 的浏览器中输入“http://192.168.1.2/aphpfile.php”。而且,我没有得到预期的结果。浏览器只是说它无法访问该页面。我不是网络专家。请帮我。
PS:请不要将此问题作为重复问题关闭。我在此网站上搜索了相关问题,但没有发现任何对我有帮助的内容。
I connected two PCs (say PC1 and PC2) using a patch cable (Category 5E) while both of them run on Windows 7. The IP addresses for PC1 and PC2 are 192.168.1.2 and 192.168.1.3, respectively. I've successfully configured a homegroup for the two computers and there was no problem in simple file sharings.
What I should know is that, having installed WAMPServer and stored some PHP files in PC1's root directory, how could I access them from PC2? I tried typing 'http://192.168.1.2/aphpfile.php' in the PC2's browser. And, I got no expected result. The browser simply said that it could not access the page. I'm not an expert in networking. Please help me.
PS: Please, don't close this question as a duplication. I searched related questions in this site but nothing was found helpful to me.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
默认情况下,WAMP 假定您在本地进行开发,并且不会响应机器外部发出的请求。您必须从 WAMP 菜单中单击“上线”。它将配置 Apache 以开始侦听来自计算机外部的传入连接。
By default, WAMP assumes you're developing locally and will not answer requests made from outside the machine. You have to click "put online" from the WAMP menu. It will configure Apache to start listening for incoming connections from outside your machine.