正如标题所示,我可以很好地访问本地主机,但我的应用程序需要通过 127.0.0.1:8000 从 twitter 进行回调,而 127.0.0.1:8000 收到“连接被拒绝”
编辑:这看起来是 IPv6 冲突,我可以通过(Apache 端口)http://127.0.0.1:8888/ 访问我的本地服务器
编辑:如果我在端口 9000 上提供 Angular 应用程序,我可以通过 127.0.0.1:9000
访问它在我的浏览器中很好,但是如果我运行 php artisan serve --port=9000
然后我仍然收到连接拒绝错误。
所以我的问题已经细化为:我怎样才能得到php artisan serve
(对于 laravel 应用程序)与 http://127.0.0.1:8000/ 一起使用
Lewiss-MBP:stripe2 Lewis$ php artisan serve
Laravel development server started on http://localhost:8000/
肉:
OSX 优胜美地 10.10.5
MAMP(非专业版)设置为 Apache 而不是 NGINX
etc/hosts : file -b /etc/hosts
=== ASCII 英文文本
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
Lewiss-MBP:applications Lewis$ telnet -6 ::1 8000 </dev/null
Trying ::1...
Connected to localhost.
Escape character is '^]'.
Connection closed by foreign host.
Lewiss-MBP:applications Lewis$ telnet -4 127.0.0.1 8000 </dev/null
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused
telnet: Unable to connect to remote host
最佳答案
l;博士;已解决:经过大量拖网后,如果我运行 php artisan serve --host 0.0.0.0
我的应用程序工作正常,Twitter 应用程序回调到 127.0.0.1 也是如此
问题一定在于 Artisan 如何倾听......
关于macos - MAC、MAMP、127.0.0.1 连接被拒绝,本地主机正常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32081279/