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条)

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度