You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Laravel Sail无法连接Stripe及Mailtrap等外部API求助

容器内无法解析Stripe/Mailtrap域名,且重新构建时apt-get无法访问端点

原本运行正常的项目突然出现网络问题:

具体错误信息

Stripe API连接错误

Could not connect to Stripe (https://api.stripe.com/v1/setup_intents). 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 6]: Could not resolve host: api.stripe.com)

Mailtrap SMTP连接错误

Connection could not be established with host "smtp.mailtrap.io:587": stream_socket_client(): php_network_getaddresses: getaddrinfo for smtp.mailtrap.io failed: Temporary failure in name resolution

已执行的排查操作

尝试删除容器并重新构建镜像,但构建过程中执行apt-get命令时,因无法访问端点报错:

sail down -v
sail build --no-cache

内容的提问来源于stack exchange,提问作者Mohamed Abdallah

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.05 15:45:36