php - 无法使用 file_get_contents 找到包装器 "https"

标签 php apache https file-get-contents

使用 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

我这样做了,但我仍然遇到问题......

还能是什么?

最佳答案

SOLVED

要解决此错误,您需要在网络服务器 上安装PHP 的OpenSSL 包。

FreeBSD 服务器上,您可能需要安装以下软件包:php53_openssl 并重新启动您的网络服务器。

Windows 服务器上,打开您的 php.ini 配置文件并简单地取消注释以下行:

 ;extension=php_openssl

然后重新启动网络服务器。应该解决错误。

引用:我从 this link 学到的这对我有用……所以功劳归于他。

关于php - 无法使用 file_get_contents 找到包装器 "https",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18643572/

相关文章:

php - 将工作负载从 PHP 转移到 MySQL

apache - 更改 httpd.conf 后重新启动 httpd

php - 如何修复间歇性 PHP fatal error : Unknown: Cannot find save handler '/var/lib/php/session'

apache - Localhost XAMPP 5.6.3-0 对图像抛出 403(禁止)

azure - 如何信任 Azure Web 应用程序中的 Active Directory 根 CA 证书?

php - Laravel Backpack - 显示关系函数中的特定属性

php - 将数据库记录与上传文件夹中的图像相匹配

php - 为什么这有效 : if ( isset($var) && $var ){

security - 我们如何确保浏览器实际检查 CA 的 SSL 证书?

node.js - 在 nodejs : cert. crt 和 sf_bundle-g1-g2.crt 中使用 GoDaddy 的 HTTPS 证书