出现file_get_contents(): SSL operation failed with code 1的错误

方法需要添加参数,如下:

$stream_opts = [
"ssl" => [
"verify_peer"=>false,
"verify_peer_name"=>false,
]
]; $response = file_get_contents("https://www.example.com",
false, stream_context_create($stream_opts));

解決方法參考:

  1. file_get_contents(): SSL operation failed with code 1. And more
  2. ile_get_contents SSL operation failed with code 1 SSL3_GET_SERVER_CERTIFICATE certificate verify failed

file_get_contents(): SSL operation failed with code 1的更多相关文章

  1. 安装 composer SSL operation failed with code 1

    gavin@webdev:~> curl -sS https://getcomposer.org/installer | php Downloading... Download failed: ...

  2. phpmailer发送邮件出现错误:stream_socket_enable_crypto(): SSL operation failed with code 1.

    如果开了调试,调试进去会看到错误提示: smtp_code:"stream_socket_enable_crypto(): SSL operation failed with code 1. ...

  3. composer在update时提示file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO

    在开发的时候,需要把依赖的服务更新到最新,然后 手动composer update一下,提示如下: failed) Update failed (The "e "https://a ...

  4. 使用PHPMailer 中的报错解决 "Connection failed. Error #2: stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages:"

    PHPMailer项目地址:https://github.com/PHPMailer/PHPMailer 项目中用到PHPMailer,使用过程中报错:"Connection failed. ...

  5. composer 安装提示 PHP Warning: readfile(): SSL operation failed with code 1

    这是php设置openssl 没有指定cacert.pem (证书) 第一步:下载 cacert.pem 文件下载地址 https://curl.haxx.se/docs/caextract.html ...

  6. PHP函数file_get_contents()使用 https 协议时报错:SSL operation failed

    场景: file_get_contents() 函数是用于将文件的内容读入到一个字符串中,是读取文件内容常用的函数之一. 但是有时在服务器上使用file_get_contents() 函数请求http ...

  7. failed to open stream: operation failed

    # composer require oygza/aliyun-php-sdk-afs You are running composer with xdebug enabled. This has a ...

  8. Error: ORA-16501: the Data Guard broker operation failed ORA-16625: cannot reach database

    在备库上建配置文件 DGMGRL> create configuration 'sharkdbbork' as primary database is 'sharkdb' connect ide ...

  9. hive subprocess failed with code X 的错误码对应信息

    PipeMapRed.waitOutputThreads(): subprocess failed with code X ,这里code X对应的信息如下:error code 1: Operati ...

随机推荐

  1. Redis事务 和 pipleline

    1.reidis事务 Redis 事务可以一次执行多个命令, 并且带有以下三个重要的保证: 批量操作在发送 EXEC 命令前被放入队列缓存. 收到 EXEC 命令后进入事务执行,事务中任意命令执行失败 ...

  2. Puppeteer自动化测试cnode.js中文社区

    如果完全不了解puppeteer的朋友可以去看看我的这篇随笔:https://www.cnblogs.com/zlforever-young/p/11569890.html 开始之前需要了解的知识:E ...

  3. react中替换关键字并且高亮显示的方法

    在react项目中,将关键字高亮显示 : 首先封装一个方法,只需要传入('要检索的内容','检索的关键字','给内容中的关键字加上的有特殊标记的标签名')这三个参数即可高亮显示关键字.详见:https ...

  4. BiLSTM介绍

    https://www.jiqizhixin.com/articles/2018-10-24-13 (机器之心)

  5. linux磁盘空间占用分析

    df -h # 查看目前磁盘空间占用 cd / # 切换到根目录 du -sh # 查询每个目录占用的大小 lsof | grep delete # 查看当前系统打开文件 # 删除不使用的文件, 如果 ...

  6. 安卓8.0真机运行appium1.4遇到的问题:运行自动化脚本,手机自动安装 settings.apk和unclock.apk,执行脚本时提示安装UnicodeIME-debug.apk失败,怎么关掉自动安装?

    运行自动化脚本,手机自动安装 settings.apk和unclock.apk,执行脚本时提示安装UnicodeIME-debug.apk失败,怎么关掉自动安装? 这3个apk的目录分别是: D:\P ...

  7. Yii2使用PHPExcel读取excel

    个人使用过程中保存一些使用PHPExcel的经验,以便后来翻阅:与PHP的Yii框架结合,可以轻松使用.而且根本不用网上所说的修改Yii的自动加载文件等方法.具体使用方法:下载phpoffice ht ...

  8. 【Flutter学习】基本组件之图片组件Image

    一,概述 Image(图片组件)是显示图像的组件,一个显示图片的widget,支持图像格式:JPEG,PNG,GIF,动画GIF,WebP,动画WebP,BMP和WBMP. Image组件有多种构造函 ...

  9. cartographer和ROS的坐标系关系

    参考定义见:backpack_3d.lua    Local map frame是一次slam过程中的原点.但是现在cartographer支持Incremental mapping.global m ...

  10. 【spring】1.2、Spring Boot创建项目

    Spring Boot创建项目 在1.1中,我们通过"Spring Starter Project"来创建了一个项目,实际上是使用了Pivotal团队提供的全新框架Spring B ...