我正在尝试使用带有直接URL的CURL读取PHP中的.docx和.doc文件,但是我收到了一些错误。
这是我的代码:
<?php
function curl_get_contents($url)
{
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
$url = "https://msysmhsptkazqgnbycne.s3.amazonaws.com/user/RP_Plagscan_1487681880_8206_WV_1486967057_3815_Working Thesis-12 Jul.docx";
$json = json_decode(curl_get_contents($url));
?>
它显示以下错误:
HttpVersionNotSupported不支持指定的HTTP版本.AED9E1B975ADE9E9FHiIIYR / l / U5r7WOv3KClqBHKdlTguYBTfnd + tWtI / 1UUUznjgm1wHzxrXSWI32pzeeGAKLxYNNgJVdDrqdgwXMYNhJy / Vcl