macos - MAC、MAMP、127.0.0.1 连接被拒绝,本地主机正常

标签 macos apache server localhost mamp

正如标题所示,我可以很好地访问本地主机,但我的应用程序需要通过 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/

相关文章:

css - Apache 提供过时的 CSS

php - 如何使用android设备将数据插入mysql?

c - ap_log_error 没有登录我的 apache 模块

c# - C# 中的 PHP Web 服务 : Invoke() function returns null

java - Tomcat 9 无法在 Ubuntu 上使用 Java 10

ssl - 如何使用 nginx 和 cloudflare 将 www 重定向到非 www 并将 http 重定向到 https?

macos - 代码设计首选项 Pane 结果为 "object file format unrecognized, invalid, or unsuitable"

xcode - 我不是团队代理,如何使用开发者 ID 签署 mac 应用程序?

python - Python 的 'Extras' 和 'site-packages' 目录有什么区别?

html - 在 Mac 上将 plist xml 文件转换为 html/pdf 格式