我正在設置信用卡處理,並需要使用CURL的解決方法。當我使用測試服務器(不調用SSL URL)時,下面的代碼工作正常,但現在當我使用HTTPS在工作服務器上測試它時,它失敗並顯示錯誤消息「未能打開流」。如何獲取file_get_contents()以使用HTTPS?
function send($packet, $url) {
$ctx = stream_context_create(
array(
'http'=>array(
'header'=>"Content-type: application/x-www-form-urlencoded",
'method'=>'POST',
'content'=>$packet
)
)
);
return file_get_contents($url, 0, $ctx);
}
這就是說沒有https封裝器。 – 2009-12-29 18:02:17
@volker這就是爲什麼我要求allow_url_fopen – Gordon 2009-12-29 18:05:17
那麼奇怪的是,它說openssl是關閉的,但根據phpinfo()它編譯它,除非我看到它是錯誤的。 – 2009-12-29 18:09:11