V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
abellis
V2EX  ›  PHP

PHP file_get_contents 获取 https 页面,报 failed to open stream

  •  
  •   abellis · Jun 25, 2019 · 4176 views
    This topic created in 2498 days ago, the information mentioned may be changed or developed.

    如题,

    问题是在网站更换了域名和 ssl 证书后引起,用原来测试的域名和证书 file_get_contents 是没问题的。测试的证书是阿里云免费的 dv 证书,正式的证书是阿里付费的 Symantec EV 证书。

    服务器环境是 apche,https 页面可以正常访问,file_get_contents 其他 https 页面没问题,比如 https://www.baidu.com 可以正常获取到。

    因为代码及服务器配置没动,所以基本确定是更换了 EV 证书引起的,不知道还需要什么配置,有没有大神遇到过?

    3 replies    2019-06-26 22:38:11 +08:00
    vibbow
        1
    vibbow  
       Jun 25, 2019
    https://www.ssllabs.com/ssltest/
    先 ssllabs 测试一波,看有没有什么警告
    tony601818
        2
    tony601818  
       Jun 25, 2019
    时间对吗?
    降低日志级别试试。
    Hardrain
        3
    Hardrain  
       Jun 26, 2019
    考虑换 curl?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3355 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 45ms · UTC 13:06 · PVG 21:06 · LAX 06:06 · JFK 09:06
    ♥ Do have faith in what you're doing.