我正在尝试使用XMLDocument动态生成xml并添加到AWS S3存储桶中的文件夹
public static function putXML_To_Bucket($bucket, $dom, $location) {
$rest = new S3Request('PUT', $bucket, $location);
$rest->data = $dom->saveXML();
$rest->size = strlen($rest->data);
$rest->setHeader('Content-Type', 'application/xml');
$rest = $rest->getResponse();
var_dump($rest);
if ($rest->error === false && $rest->code !== 200)
$rest->error = array('code' => $rest->code, 'message' => 'Unexpected HTTP status');
if ($rest->error !== false) {
trigger_error(sprintf("S3::putBucket({$bucket}, {$acl}, {$location}): [%s] %s",
$rest->error['code'], $rest->error['message']), E_USER_WARNING);
return false;
}
return true;
}
var_dump($ rest)产生此错误
object(stdClass)#9 (1) {
["error"]=>
array(3) {
["code"]=>
int(60)
["message"]=>
string(63) "SSL certificate problem: unable to get local issuer certificate"
["resource"]=>
string(34) "/mybucket/"
}
}
注意我是从localhost开发的。
我不知道为什么会这样。任何帮助将不胜感激。