相关疑难解决方法(0)

无法找到包装器"https" - 您是否忘记在配置PHP时启用它?

问题在于问题.我已经对这方面的解决方案进行了彻底的调查,我知道有这方面的主题,我也跟着他们,没有任何工作.话虽这么说,我会列出到目前为止我所做的一切.我在Windows XP计算机上的最新Eclipse版本上使用Zend Debugging运行PHP 5.2.14.我有1 GB的RAM.我安装了运行Apache,MySQL和FileZilla的XAMPP.

在XAMPP上我做了以下操作(在这些更改期间Apache已关闭):从XAMPP控制面板单击Admin并转到https:// localhost/xampp/.从那里我在欢迎页面上接受了这一行的证书:

对于OpenSSL支持,请使用https:// 127.0.0.1或https:// localhost的测试证书.

在同一部分,我检查phpinfo().在"环境"下,SERVER["HTTPS"]on.在'Apache Environment'下,HTTPSOn.在"PHP变量"下,_SERVER["HTTPS"]On.在'Phar'下,OpenSSL supportdisabled(安装ext/openssl).我不知道如何启用Phar one.

现在关于C:\ xampp中的文件本身,我去了PHP文件夹.在生产和开发的php.ini文件(防患于未然),我allow_url_fopen=On,allow_url_include=On和我删除了分号,所以extension=php_openssl.dll不再注释掉.我甚至确认.dll位于PHP文件夹的ext文件夹中.libeay32.dll和ssleay32.dll都在PHP和Apache文件夹中.Apache文件夹不包含生产或开发php.ini文件.

为了安全起见,我去了http://www.slproweb.com/products/Win32OpenSSL.html并安装了Win32 OpenSSL v1.0.0d.

现在我的retrieve_website.php中的代码行如下所示:

$urlquery = "https://www.googleapis.com/customsearch/v1?key=".$appid."&cx=".$google_searchid."&q=".$query."&alt=atom&num=".$results;
$xmlresults = file_get_contents($urlquery);
Run Code Online (Sandbox Code Playgroud)

我有两个其他网站,我查询,但他们通过HTTP服务,他们工作正常.我还在脚本末尾附近输入了这行代码:

echo 'openssl: ',  extension_loaded  ('openssl') ? 'yes':'no', "\n";
echo 'http wrapper: ', in_array('http', $w) ? 'yes':'no', "\n";
echo 'https wrapper: ', in_array('https', $w) …
Run Code Online (Sandbox Code Playgroud)

php apache xampp https openssl

136
推荐指数
12
解决办法
21万
查看次数

如何让file_get_contents()与HTTPS一起使用?

我正在设置信用卡处理,需要使用CURL的解决方法.当我使用测试服务器(没有调用SSL URL)时,以下代码工作正常,但现在当我在使用HTTPS的工作服务器上测试它时,它失败并显示错误消息"无法打开流".

function send($packet, $url) {
  $ctx = stream_context_create(
    array(
      'http'=>array(
        'header'=>"Content-type: application/x-www-form-urlencoded",
        'method'=>'POST',
        'content'=>$packet
      )
    )
  );
  return file_get_contents($url, 0, $ctx);
}
Run Code Online (Sandbox Code Playgroud)

php https curl file-get-contents

99
推荐指数
8
解决办法
28万
查看次数

XAMPP和file_get_contents("https:// ...")

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

$url2="https://....";
$content=file_get_contents($url2);
Run Code Online (Sandbox Code Playgroud)

这就是我得到的错误:

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
Run Code Online (Sandbox Code Playgroud)

为了能够获取https://包装器的URL内容,我该怎么办?

提前致谢

php xampp

2
推荐指数
1
解决办法
1万
查看次数

标签 统计

php ×3

https ×2

xampp ×2

apache ×1

curl ×1

file-get-contents ×1

openssl ×1