简体   繁体   English

如何通过另一个网络上的浏览器打开laravel应用程序(使用公共ip)

[英]How to open laravel application by a browser on another network (using public ip)

I have laravel application in my server. 我的服务器中有laravel应用程序。 I can access the server by remote desktop. 我可以通过远程桌面访问服务器。 And when im in the server, I used the "php artisan serve" and it worked. 当我在服务器中使用即时消息时,我使用了“ php artisan serve”,并且可以正常工作。 It will open the home view when we hit "localhost:8000". 当我们点击“ localhost:8000”时,它将打开主视图。 But here is the question: 但这是一个问题:


How can I open the laravel application served by the server from my computer's browser? 如何从计算机的浏览器中打开服务器提供的laravel应用程序?
(I mean without remote desktop, just open it with my browser. My server and my computer is not physically connected, they're connected by the internet which mean I must use the server's public ip to access the application) (我的意思是没有远程桌面,只需用浏览器打开它即可。我的服务器和计算机没有物理连接,它们通过Internet连接,这意味着我必须使用服务器的公共IP来访问应用程序)
let's say the public ip of the serve is : 123.123.123.123 假设服务的公共IP为:123.123.123.123


I do this to test my application. 我这样做是为了测试我的应用程序。 If you think you can help please don't hesitate post it. 如果您认为可以提供帮助,请随时发布。 Thank you 谢谢

I already tried "php artisan serve --host 0.0.0.0 --port 8000" on the server and visit "ip address:port" from another device but it didn't work. 我已经在服务器上尝试过“ php artisan serve --host 0.0.0.0 --port 8000”,并从另一台设备访问“ ip address:port”,但是它没有用。

And I got this message: 我收到了以下消息:

This site can’t be reached

refused to connect
Search Google for
ERR_CONNECTION_REFUSED

First start your server as "php artisan serve --host 0.0.0.0 --port 8000" 首先以“ php artisan serve --host 0.0.0.0 --port 8000”启动服务器

Then run this url "123.123.123.123:8000" from your another device 然后从另一台设备运行此网址“ 123.123.123.123:8000”

Hamachi简单又安全的方法,但是免费版本有5个成员限制

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM