本文详细记录了 PHP 使用 curl
遇到的问题。
官方文档:http://php.net/manual/zh/book.curl.php
设置网址
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data)
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);
// 设置 CA 根证书路径
curl_setopt($ch, CURLOPT_CAINFO, $value);
// 检查证书域名
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, $value);
// 设置私钥路径
curl_setopt($ch, CURLOPT_SSLKEY, $value);
// 设置公钥路径
curl_setopt($ch, CURLOPT_SSLCERT, $value);
curl_setopt($ch, CURLOPT_USERPWD, $user.':'.$password);
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有