首页
📷在线壁纸
🎬娱乐天地
🔖友情链接
更多
📝留言板
Search
1
【javascript】JS-向当前url追加参数
2,345 阅读
2
【PHP】生成随机昵称
2,219 阅读
3
【PHP】判断一个字符串是否属于序列化后的数据
2,024 阅读
4
【css】html+css给文章页,做阅读全文
1,975 阅读
5
【PHP】 设计模式(23种)
1,910 阅读
📂默认分类
💓typecho
🏳️🌈代码改变世界
🍇 mysql
🍈 Winform
🍓 golang
🍉 设计模式
🥝 PHP
🍎 python
🍊 nginx
🍋 网络安全
🍍 javascript
🫑 database
🍭文艺范
🍏mac
AI
LLM
image
audio
yolo
3D
code
登录
Search
标签搜索
php
typecho
代码注释
redis
mysql
go
golang
nginx
thinkphp
docker
gin
linux
curl
html
mamp
算法
短网址
构造函数
webhook
代码片段
依然范儿特西
累计撰写
145
篇文章
累计收到
1
条评论
首页
栏目
📂默认分类
💓typecho
🏳️🌈代码改变世界
🍇 mysql
🍈 Winform
🍓 golang
🍉 设计模式
🥝 PHP
🍎 python
🍊 nginx
🍋 网络安全
🍍 javascript
🫑 database
🍭文艺范
🍏mac
AI
LLM
image
audio
yolo
3D
code
页面
📷在线壁纸
🎬娱乐天地
🔖友情链接
📝留言板
搜索到
2
篇与
的结果
2022-06-21
curl超时的设置
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 2);curl_setopt($ch, CURLOPT_TIMEOUT, 1);CURLOPT_CONNECTTIMEOUT 是从请求开始到响应总共等待的时间,CURLOPT_TIMEOUT是响应等待的时间,后面的数字是等待的秒数(单位秒)也可以设置毫秒:CURLOPT_CONNECTTIMEOUT_MSCURLOPT_TIMEOUT_MS因为在请求第三方接口时发现,如果只设置了 CURLOPT_TIMEOUT 还是不可避免的会出现延时和卡顿的情况,遂设置了 CURLOPT_CONNECTTIMEOUT,CURLOPT_CONNECTTIMEOUT 是完全控制在请求方的,只要指定时间没返回数据,就主动断开,不会被延时数据影响到完整代码 curlPost('http://www.richerdyoung.com',[]); function curlPost($url , $data=[]){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); curl_setopt($ch, CURLOPT_NOSIGNAL, 1); curl_setopt($ch, CURLOPT_TIMEOUT_MS, 20); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT_MS, 20); // POST数据 curl_setopt($ch, CURLOPT_POST, 1); // 把post的变量加上 curl_setopt($ch, CURLOPT_POSTFIELDS, $data); $output = curl_exec($ch); $curl_errno = curl_errno($ch); $curl_error = curl_error($ch); curl_close($ch); return $output; }
2022年06月21日
103 阅读
0 评论
2 点赞
2021-06-28
【PHP】cURL error 60: SSL certificate unable to get local issuer certificate
导致该问题的原因在于没有配置curl.cainfo,该配置位于php.ini中解决方案:1 下载cacert.pemhttps://curl.haxx.se/ca/cacert.pem2 配置 php.ini[curl] ; A default value for the CURLOPT_CAINFO option. This is required to be an ; absolute path. curl.cainfo = 【你的绝对路径】记得重启php
2021年06月28日
196 阅读
0 评论
1 点赞