php curlによくあるエラー:SSLエラー、boll(false)

1551 ワード

症状:php curl httpsの呼び出しエラーのチェック方法:コマンドラインでcurlを使って呼び出してみてください。理由:サーバがあるマシンルームはSSL証明書を検証できません。解決方法:SSL証明書のチェックをスキップします。curlsetopt($ch,CURLOPT_)SSLVERFYPE、false症状:php curlコールガールexecはbookに戻り、コマンドラインのcurl呼び出しが正常です。検査方法:var_dump(curl_)error($ch))戻る:string(23)「Empty reply from server」再チェック:curl_setopt($ch,CURLOPT_)HEADER、true)curlsetopt($ch,CURLOPT_)RETURNTRANDER,false;返信:HTTP/1.1 100 Continue Connection:close原因:php curlはHTTP 100を受信して終了しました。HTTP 200解決策を引き続き受信するべきです。setopt($ch,CURLOPT_)HTTPHEADER,array('Expect:')PHP and cURL:Displaling 100-continue header Published June 15 th、2006 I've been using cURL(through PHP)to build a sort of proxy for a project I'm working on.I ned to parse the returned headers(to fiver the the cover the the cover the cover the conked Strever the conked Start)HTmput Stope stant Stard Stard Stard Store。but for some reason barfed in this case.A closer look at was being returned revealed that for some reason、Apache was prepending the'normal'headers with an extrateponse header:HTTP/1.1 Continue 2002009 Jun 2006 2006:23:42 GMT Server:Apaache...A bit of Googling revealed thththththiswas to do with a headterthaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaattttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttts s s s s s s s s s s s s s s s P,which seemid a bit clumsy.Finally,on a hunh I tried this:curl_setopt($curl_)handle,CURLOPT_HTTPHEADER,array('Expect:')which baically overrides the original‘Expect:'header with an empty one.Hope this helps someone.