2012-11-27 142 views
0

當我檢查S3存儲桶中是否存在對象時,我不斷收到來自AWS S3 API的此錯誤。AWS S3 PHP SDK錯誤 - PHP致命錯誤:找不到類'RequestCore'

的代碼看起來就像這樣:
第一個文件:

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

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

第二個文件:

<?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) { 
    .... 
    } 
?> 

詳細
EC2映像:AMI-49ec5a20
SDK:SDK-1.5.17
PHP版本:5.3.15
登錄

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 

難道我做錯了什麼?

回答

0

好的。我犯了一個愚蠢的錯誤。

當從SDK中刪除文檔和示例目錄時,我也刪除了包含所有重要類的lib目錄(當時我做到了,它已經很晚了:))。

返回後,一切正常。

相關問題