【问题标题】:XAMPP And file_get_contents("https://...")XAMPP 和 file_get_contents("https://...")
【发布时间】:2012-07-12 07:13:12
【问题描述】:

我尝试在 xampp 上运行下一个代码:

$url2="https://....";
$content=file_get_contents($url2);

这就是我遇到的错误:

Warning: file_get_contents() [function.file-get-contents]: Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in C:\xampp\htdocs\whoTalk\sys\user.php on line 38

我必须做什么才能获得 https:// 包装器的 url 内容?

提前致谢

【问题讨论】:

    标签: php xampp


    【解决方案1】:

    在您的 php.ini 中搜索以下内容:

    extension=php_openssl.dll

    如果它存在并已评论,请取消评论。如果它不存在,请添加它:-)

    【讨论】:

    • 我已经添加了这个设置,但仍然出现这个错误......我是否必须以某种方式刷新 xampp 设置?
    • 你需要重启 Apache
    【解决方案2】:

    我在 WAMP 中添加了

    allow_url_include = On
    extension=php_openssl.dll
    extension=php_curl.dll
    

    我能找到的所有 3 个 php.ini 文件,即

    \wamp\bin\php\php5.4.12\php.ini
    \wamp\bin\php\php5.4.12\phpForApache.ini
    \wamp\bin\apache\Apache2.4.4\bin\php.ini
    

    我不知道实际需要哪个.ini文件的具体设置,但是现在接受https了....

    【讨论】:

      【解决方案3】:

      您需要在 XAMPP 中启用 PHP 的 OpenSSL 扩展才能从安全服务器中获取任何内容。

      【讨论】:

        猜你喜欢
        • 2020-12-05
        • 2011-09-17
        • 2010-12-30
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2012-12-10
        相关资源
        最近更新 更多