Reputation: 4750
I have been using this PHP class to upload images to S3. Here's an example code:
$s3 = new S3($awsAccessKey,$awsSecretKey);
$s3upload= $s3->putObject(
$s3->inputFIle($tmp_name, false),
$s3BucketName,
$filename,
S3::ACL_PUBLIC_READ
);
Out of nowhere I have been getting this error today:
Warning</b>: S3::putObject(): [7] Failed to connect to bucketName.s3.amazonaws.com port 80: No route to host in <b>/S3.php</b> on line <b>355
I have used the following script to check the curl settings, and I can get the whole google page, so there shouldn't be any problem with CURL
$ch = curl_init("http://google.com"); // initialize curl handle
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
$data = curl_exec($ch);
print($data);
Anyone using that PHP class? Have you experienced this problem? How can I find out where the problem lays?
Upvotes: 2
Views: 1244
Reputation: 5721
I would recommend the official PHP library as well, it's well documented and works well.
No route to host might suggest network problems on your server.
Can you ping bucketName.s3.amazonaws.com from the server?
Upvotes: 1
Reputation: 33186
This can happen when some api calls get outdated. I would recommend using the official php libraries. They work almost the same way this library works, but they are being kept up-to-date by Amazon programmers.
Upvotes: 3