file_get_contents(): SSL operation failed with code 1
出现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));
解決方法參考:
- file_get_contents(): SSL operation failed with code 1. And more
- 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的更多相关文章
- 安装 composer SSL operation failed with code 1
gavin@webdev:~> curl -sS https://getcomposer.org/installer | php Downloading... Download failed: ...
- phpmailer发送邮件出现错误:stream_socket_enable_crypto(): SSL operation failed with code 1.
如果开了调试,调试进去会看到错误提示: smtp_code:"stream_socket_enable_crypto(): SSL operation failed with code 1. ...
- 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 ...
- 使用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. ...
- composer 安装提示 PHP Warning: readfile(): SSL operation failed with code 1
这是php设置openssl 没有指定cacert.pem (证书) 第一步:下载 cacert.pem 文件下载地址 https://curl.haxx.se/docs/caextract.html ...
- PHP函数file_get_contents()使用 https 协议时报错:SSL operation failed
场景: file_get_contents() 函数是用于将文件的内容读入到一个字符串中,是读取文件内容常用的函数之一. 但是有时在服务器上使用file_get_contents() 函数请求http ...
- failed to open stream: operation failed
# composer require oygza/aliyun-php-sdk-afs You are running composer with xdebug enabled. This has a ...
- 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 ...
- hive subprocess failed with code X 的错误码对应信息
PipeMapRed.waitOutputThreads(): subprocess failed with code X ,这里code X对应的信息如下:error code 1: Operati ...
随机推荐
- cordova 配置 高德地图sdk定位
获取 sha1 打开 cmd 1. cd .android 2. keytool -list -v -keystore debug.keystore 3. 输入密钥: android 4. 复制 sh ...
- java笔试手写算法面试题大全含答案
1.统计一篇英文文章单词个数.public class WordCounting {public static void main(String[] args) {try(FileReader fr ...
- Tmux 简单配置使用
Tmux Prefix (prefix) Tmux 使用 Prefix 以将自身的快捷键与其它应用区分,运行 Tmux 快捷键时首先按下这个 Prefix (默认是 Ctrl-b 组合键),松手后紧接 ...
- vue全家桶(vue2.x+vue-router+axios+webpack)项目搭建
参考博客文章 博主FungLeo的Vue2+VueRouter2+Webpack+Axios 构建项目实战2017重制版 注:原博主写的非常详细 本文章为根据原博主教程总结的自己的搭建流程 一.安装n ...
- C# 三层架构的一个小练习(Winfrom与SQLite数据库组合)
本文文字方面引用 微冷的風丶(博客地址:https://www.cnblogs.com/smbk/) 代码部分是本人亲自写的一个sqlite数据库的最简单登录界面练手(当时写的太烂了,现在回顾重构一下 ...
- CSS文本垂直居中显示
<style> .sty1 { width: 300px; height: 200px; background-color: black; text-align: center; colo ...
- bootstrap相关使用
如果想做成响应式效果,使用栅格系统产生 小于768手机端 : col-xs- 大于768小于992平板 : col-sm- 大于992小于1200 : col-md- 大于1200 : col-lg- ...
- Vue学习笔记【20】——Vue中的动画(使用动画钩子函数)
定义及使用钩子函数 定义 transition 组件以及三个钩子函数: <div id="app"> <input type="button&q ...
- 管理员技术(七): Linux管理员 综合测试
一.Linux管理员 综合测试 目标: 根据本文提供的练习步骤完成所有练习案例. 方案: 开始练习之前,先依次重置虚拟机环境. [root@room9pc13 ~]# rht-vmctl reset ...
- 在C#.NET中,如何生成PDF文件?主要有以下几个途径
1.使用.NET文件流技术:若通过.NET的文件流技术生成PDF文件,必须对PDF文件的语法很清楚,例如BT表示实体内容开始:ET表示实体内容结束:TD表示换行等等.我们可以从Adobe的官方网站上下 ...