【发布时间】:2013-09-09 17:10:25
【问题描述】:
使用 https:// url 调用 file_get_contents() 会出现以下错误:
warning: file_get_contents(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP?
我已经阅读了 10 多个 SO 问题,他们都说要启用 extension=php_openssl.dll
我这样做了,但我仍然遇到问题......
还能是什么?
【问题讨论】:
-
我们可能需要更多信息来帮助您...我假设您在尝试加载 .dll 时运行 Windows?你能尝试运行
phpinfo()并寻找一行写着:OpenSSL support enabled吗?应该在标题“openssl”下。 -
您要连接到哪个 URl?你能打开namhost.com吗?我刚刚在尝试连接到 Facebook URL 时发现它吐出 400 错误,因为参数不正确,结果是我的 IP 地址在设置中设置不正确。 IE。我可以访问 HTTPS 链接,但不能访问 facebook。
-
请参阅stackoverflow.com/questions/5444249/… 以获得体面的答案。仔细阅读答案并在适当的
php.ini中启用扩展。不要忘记重新启动 Apache。 -
能否运行
php -i(cli) 或phpinfo()(web) 来查看扩展是否真正启用?如果您不知道如何查看它是否已启用,请发布结果。
标签: php apache https file-get-contents