doudang8824 2014-06-25 16:15
浏览 397
已采纳

file_get_contents(https:// url)失败[关闭]

On my Ubuntu 12.04 server running PHP 5.5 on Lighttpd I have

  • allow_url_fopen On
  • allow_url_include On
  • OpenSSL Support Enabled
  • OpenSSL Library/Header Version 1.0.1 14 Mar 2012

I am not sure this is right but I also put in extension=openssl.so in my php.ini file and rebooted by server. I see no untoward error messages in my logs.

Nevertheless I still get failed to open stream: Connection timed out. The same URL without https works just fine. Am I missing something

  • 写回答

2条回答 默认 最新

  • douci1851 2014-06-25 20:21
    关注

    As someone said above this is a network issue. Actually, I was wrong when I said that http://exmaple.com worked whilst https://example.com did not. I run four servers, call them A, B, C & D at different global locations - two in the US, one in Europe and one in Asia. The URL that I am trying to reach is for another server in the US. After posting this question and reviewing the various comments I explored matters a bit more and discovered that my file_get_contents call was failing only from the Asian server. TraceRoute revealed that the Asian server is simply unable to locate the one I want to reach. So as someone here said - this is a network issue. I am posting this answer so anyone who runs into this thread in quest of a solution to a similar problem realizes that this might well be the problem rather than a PHP configuration thing.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器