0

I keep getting this error from AWS S3 API when checking if object exists in my S3 bucket.

The code looks something like that :
First file :

<?php 
require_once 'sdk-1.5.17/sdk.class.php';
require_once 'ReportHandler.php';

$report_handler = new ReportHandler();
$report_handler->generateWeeklyTotalsReport();
?>

Second file :

<?php
class ReportHandler {
     private $s3;

     public function __construct() {
          $this->s3 = new AmazonS3(); 
     }
     public function generateDailyTotalsReport() {
     ....
          if($this->s3->if_object_exists(BUCKET_NAME,OBJECT_NAME) {
     ....
    }
?>

Details :
EC2 IMAGE : ami-49ec5a20
SDK : sdk-1.5.17
PHP Version : 5.3.15
Log :

Mon Nov 26 17:30:29 2012 error http://client 10.195.122.171 PHP Fatal error: Class   'RequestCore' not found in /var/www/html/sdk-1.5.17/utilities/request.class.php on line 30  
Mon Nov 26 17:30:29 2012 error http://client 10.195.122.171 PHP Stack trace:  
Mon Nov 26 17:30:29 2012 error http://client 10.195.122.171 PHP 1. {main}()   /var/www/html/WeeklyReport.php:0  
Mon Nov 26 17:30:29 2012 error http://client 10.195.122.171 PHP 2. ReportHandler-  >generateWeeklyTotalsReport() /var/www/html/WeeklyReport.php:16  
Mon Nov 26 17:30:29 2012 error http://client 10.195.122.171 PHP 3. ReportHandler-  >findOrCreateReport() /var/www/html/ReportHandler.php:111  
Mon Nov 26 17:30:29 2012 error http://client 10.195.122.171 PHP 4. AmazonS3-  >if_object_exists() /var/www/html/ReportHandler.php:148  
Mon Nov 26 17:30:29 2012 error http://client 10.195.122.171 PHP 5. AmazonS3-  >get_object_headers() /var/www/html/sdk-1.5.17/services/s3.class.php:2264  
Mon Nov 26 17:30:29 2012 error http://client 10.195.122.171 PHP 6. AmazonS3->authenticate()   /var/www/html/sdk-1.5.17/services/s3.class.php:1559  
Mon Nov 26 17:30:29 2012 error http://client 10.195.122.171 PHP 7. CFLoader::autoloader()   /var/www/html/sdk-1.5.17/services/s3.class.php:0  
Mon Nov 26 17:30:29 2012 error http://client 10.195.122.171 PHP 8. require_once()   /var/www/html/sdk-1.5.17/sdk.class.php:1428

Am I doing something wrong?

4

1 回答 1

0

好的。我犯了一个愚蠢的错误。

从 SDK 中删除文档和示例目录时,我还删除了包含所有重要类的 lib 目录(我这样做的时候已经很晚了 :))。

退货后一切正常。

于 2012-11-27T08:41:09.083 回答