癥狀:php curl調(diào)用curl_exe " /> 东北疯狂xxxxbbbb中国,动漫美女被爆挤奶歪歪漫画,旧里番ovaの催○セイ活指导

天天躁日日躁狠狠躁AV麻豆-天天躁人人躁人人躁狂躁-天天澡夜夜澡人人澡-天天影视香色欲综合网-国产成人女人在线视频观看-国产成人女人视频在线观看

php curl常見(jiàn)錯(cuò)誤:SSL錯(cuò)誤、bool(false)

癥狀:php curl調(diào)用https出錯(cuò)
排查方法:在命令行中使用curl調(diào)用試試。
原因:服務(wù)器所在機(jī)房無(wú)法驗(yàn)證SSL證書(shū)。
解決辦法:跳過(guò)SSL證書(shū)檢查。
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

癥狀:php curl調(diào)用curl_exec返回bool(false),命令行curl調(diào)用正常。
排查方法:
var_dump(curl_error($ch));
返回:
string(23) "Empty reply from server"
再排查:
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, false);
返回:
HTTP/1.1 100 Continue
Connection: close
原因:php curl接收到HTTP 100就結(jié)束了,應(yīng)該繼續(xù)接收HTTP 200
解決方案:
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:'));

php and cURL: Disabling 100-continue header
Published June 15th, 2006
I've been using cURL (through php) to build a sort of proxy for a project I'm working on. I need to parse the returned headers (to recover the HTTP status), so had included a very simple script to do so. It had worked fine in the past, but for some reason barfed in this case. A closer look at what was being returned revealed that for some reason, Apache was prepending the ‘normal' headers with an extra response header:

HTTP/1.1 100 Continue

HTTP/1.1 200 OK Date: Fri, 09 Jun 2006 15:23:42 GMT
Server: Apache
...A bit of Googling revealed that this was to do with a header that cURL sends by default:

Expect: 100-continue

…which in turns tells Apache to send the extra header. I poked around a fair bit but couldn't quite find a workable solution short of manually removing the header in php, which seemed a bit clumsy. Finally, on a hunch I tried this:

curl_setopt( $curl_handle, CURLOPT_HTTPHEADER, array( 'Expect:' ) );

…which basically overrides the original ‘Expect:' header with an empty one.

Hope this helps someone.

php技術(shù)php curl常見(jiàn)錯(cuò)誤:SSL錯(cuò)誤、bool(false),轉(zhuǎn)載需保留來(lái)源!

鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標(biāo)記有誤,請(qǐng)第一時(shí)間聯(lián)系我們修改或刪除,多謝。

主站蜘蛛池模板: 亚洲一区乱码电影在线 | 欧美97色伦影院在线观看 | 国产女人乱人伦精品一区二区 | 国内精品偷拍在线观看 | 色婷婷五月综合久久中文字幕 | 羞羞麻豆国产精品1区2区3区 | 一本色道久久88综合日韩精品 | 内射后入在线观看一区 | 精品视频在线播放 | 亚洲第一综合天堂另类专 | 黑吊大战白xxxxxx | 美国caopo超碰在线视频 | 久久综合色一综合色88中文 | 大桥未久在线看 | 久久久久九九 | 成视频高清 | 久久久青青 | 久久精品视频15人人爱在线直播 | 在线观看日本免费 | 蜜柚免费视频高清观看在线 | 最近韩国日本免费观看mv免费版 | 一个人在线观看免费高清视频在线观看 | 国产一级做a爰片久久毛片男 | 最近日本MV字幕免费观看视频 | 国产乱国产乱老熟300部视频 | 最近中文字幕2019免费版日本 | 污污内射久久一区二区欧美日韩 | 秋霞电影网午夜一级鲁丝片 | 一个吃奶两个添下面H | 亚洲色无码播放 | 美女视频黄a视频全免费网站色窝 | 中文字幕一区久久久久 | 一品探花论坛 | 一二三四在线高清中文版免费观看电影 | 国产乱码卡二卡三卡4W | 亚洲AV日韩AV欧美在线观看网 | 亚洲欧洲免费三级网站 | 18女下面流水不遮网站免费 | 久久久91精品国产一区二区 | 免费久久狼人香蕉网 | 免费看毛片的网址 |