可以使用PHP Artisan服务在其他设备上访问Localhost
最近,我试图使用另一台设备在同一WiFi上访问我的Laravel Web应用程序,并且效果很好(我将IPv4复制到了 - 主机中)。但是,当我在其他WiFi上尝试使用它时,尽管遵循相同的步骤并使用正确的IPv4,但它根本不起作用。请问为什么这是这样,该如何解决?
recently I was trying to access my laravel web app on the same wifi using another device and it works well(I copied the ipv4 into the --host). However, when I tried it on a different wifi, it doesn't work at all despite following the same steps and using the correct ipv4. May I ask why is that so and how do I fix it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在Visual Code或CMD上运行此此操作,您必须在Laravel目录中,
然后转到CMD并键入以下内容:
复制IPv4地址您的设备IP ,然后只是只需将其粘贴到8000端口上的浏览器上,就应该像这个示例一样。 (
192.168.100.77:8000
)享受开发!
Run this on visual code or CMD, you must be in laravel directory,
then just go to cmd and type the following:
Copy the IPV4 Address Your device IP, and then just simply paste it on your browser with the 8000 port, it should be like this example. (
192.168.100.77:8000
)Enjoy Developing!
如果要从其他设备访问它,则应像这样启用它:
它将允许网络中的任何设备访问它,
则可以使用WiFi和以太网访问
如果您在主机中设置WiFi IPv4, 它您与以太网有联系的时间无法正常工作
If you want to access it from another device you should enable it like so :
it will allow any device in your network to access it,
and it will work with wifi and with ethernet
If you set your wifi ipv4 in the host but at the same time your are connected with ethernet it won't work