[英]PHP AWS S3 cURL error 6: Could not resolve host
I'm trying to move files across S3 buckets and am getting the following error when running CopyObject. 我试图在S3存储桶之间移动文件,并且在运行CopyObject时遇到以下错误。
dev.ERROR: exception 'Aws\\S3\\Exception\\S3Exception' with message 'Error executing "CopyObject" on "https://60_071fbf25-8654-4cef-a184-ecb241c1dfcf_20180115175327.wav"; AWS HTTP error: cURL error 6: Could not resolve host: 60_071fbf25-8654-4cef-a184-ecb241c1dfcf_20180115175327.wav
I can't figure out why the URL in the error message is https://60_071fbf25-8654-4cef-a184-ecb241c1dfcf_20180115175327.wav when it should be https://s3.us-west-2.amazonaws.com/my-bucket-name/60_071fbf25-8654-4cef-a184-ecb241c1dfcf_20180115175327.wav 我想不通,为什么在错误信息的URL是HTTPS://60_071fbf25-8654-4cef-a184-ecb241c1dfcf_20180115175327.wav何时应该https://s3.us-west-2.amazonaws.com/my -bucket-name / 60_071fbf25-8654-4cef-a184-ecb241c1dfcf_20180115175327.wav
Here's my code: 这是我的代码:
$s3 = \Aws\S3\S3Client::factory([
'credentials' => [
'key' => \Config::get('aws.s3_audio_upload.access_id'),
'secret' => \Config::get('aws.s3_audio_upload.access_secret')
],
'region' => 'us-west-2',
'version' => '2006-03-01'
]);
$s3->copyObject([
'Bucket' => 'metapop-hq-repo1',
'CopySource' => 'metapop-inbox/60_071fbf25-8654-4cef-a184-ecb241c1dfcf_20180115175327.wav',
'Key' => '60_071fbf25-8654-4cef-a184-ecb241c1dfcf_20180115175327.wav',
'ACL' => $cannedAcl
]);
Discovered that the environment variables I was using to set the contents of Bucket and the bucket part of CopySource were not set in the daemon job runner I am using. 发现我用来设置Bucket内容的环境变量和CopySource的bucket部分未在我使用的守护进程运行程序中设置。 Ensuring that these environment variables were set fixed the problem. 确保设置了这些环境变量可以解决此问题。 :) :)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.