【问题标题】:Laravel cannot not connect to StripeLaravel 无法连接到 Stripe
【发布时间】:2020-09-22 14:35:27
【问题描述】:

我无法使用我的 Laravel / React 应用程序连接到 Stripe。在本地它可以工作,而 Digital Ocean 液滴上的相同代码则不能。我收到这条消息:

Could not connect to Stripe (https://api.stripe.com/v1/invoices/upcoming?customer=cus_XXXXXXXXXX). Please check your internet connection and try again. If this problem persists, you should check Stripe's service status at https://twitter.com/stripestatus, or let us know at support@stripe.com. (Network error [errno 7]: )

这是来自 Laravel 的错误消息。重要的部分是(Network error [errno 7]: )。与遇到此错误的CURL有关:CURLE_COULDNT_CONNECT (error code 7)

我也期待像(Network error [errno 7]: Failed connect to api.stripe.com:443; Operation now in progress) 这样的东西。冒号后不能有空格。

我试过这个:

供参考,您可以在https://curl.haxx.se/libcurl/c/libcurl-errors.html 上看到错误,并表示:

CURLE_COULDNT_CONNECT (7) - Failed to connect() to host or proxy.

【问题讨论】:

  • 你的网站使用 https 吗?
  • 是的,它使用 HTTPS

标签: laravel


【解决方案1】:

这不是代码中的问题,您可能需要检查您的服务器托管服务提供商。

顺便说一句,您可能需要查看This answer。一样的。 和他通过更换服务器解决,和host provider通信时发现端口因为流量大而被阻塞。

【讨论】:

  • 我将此标记为答案,因为它解决了问题的一般原因。就我而言,是 Centos 8 服务器阻止了传出连接。用setsebool -P httpd_can_network_connect on 打开它来修复它。 -P 永久设置变量。以前它是在没有-P 的情况下设置的,因此服务器重新启动会清除该设置。
猜你喜欢
  • 2019-10-05
  • 2017-06-08
  • 2017-12-08
  • 2018-08-31
  • 2019-02-25
  • 1970-01-01
  • 1970-01-01
  • 2020-11-21
  • 2013-12-18
相关资源
最近更新 更多