Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/263.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
类别';Aws\Common\Aws';未找到cakephp_Php_Cakephp_Amazon Web Services_Amazon S3_Amazon Ec2 - Fatal编程技术网

类别';Aws\Common\Aws';未找到cakephp

类别';Aws\Common\Aws';未找到cakephp,php,cakephp,amazon-web-services,amazon-s3,amazon-ec2,Php,Cakephp,Amazon Web Services,Amazon S3,Amazon Ec2,我正在cakephp中使用AWS PHP SDK V2.8。我在AWSEC2 ubuntu机器上工作 我使用zip文件,而不是任何作曲家 我得到以下错误 Class 'Aws\Common\Aws' not found 我创建了一个自定义组件,用于访问SDK的所有功能。参考 我的文件夹结构如下 这是我的AmazonComponent.php <?php App::uses('Component', 'Controller'); use Aws\Common\Aws; /** *

我正在cakephp中使用AWS PHP SDK V2.8。我在AWSEC2 ubuntu机器上工作

我使用zip文件,而不是任何作曲家

我得到以下错误

Class 'Aws\Common\Aws' not found 
我创建了一个自定义组件,用于访问SDK的所有功能。参考

我的文件夹结构如下

这是我的AmazonComponent.php

<?php

App::uses('Component', 'Controller');
use Aws\Common\Aws;

/**
 * AmazonComponent
 *
 * Provides an entry point into the Amazon SDK.
 */
class AmazonComponent extends Component {

  /**
   * Constructor
   * saves the controller reference for later use
   * @param ComponentCollection $collection A ComponentCollection this component can use to lazy load its components
   * @param array $settings Array of configuration settings.
   */
  public function __construct(ComponentCollection $collection, $settings = array()) {
    $this->_controller = $collection->getController();
    parent::__construct($collection, $settings);
  }

  /**
   * Initialization method. Triggered before the controller's `beforeFilfer`
   * method but after the model instantiation.
   *
   * @param Controller $controller
   * @param array $settings
   * @return null
   * @access public
   */
  public function initialize(Controller $controller) {
    // Handle loading our library firstly...
      $this->Aws = Aws::factory(Configure::read('Amazonsdk.credentials'));
  }

  /**
   * PHP magic method for satisfying requests for undefined variables. We
   * will attempt to determine the service that the user is requesting and
   * start it up for them.
   *
   * @var string $variable
   * @return mixed
   * @access public
   */
  public function __get($variable) {
    $this->$variable = $this->Aws->get($variable);
    return $this->$variable;
  }
}

我错在哪里?我该如何修复?

@urfusion能否请您将AWS SDK文件夹从应用/供应商的
app/Plugin
移动到
app/Vendor
,然后尝试导入AWS SDK
AmazonComponent
功能
初始化

我正在使用AWS PHP SDK V3

//首先处理加载我们的库

 App::import('Vendor','aws-autoloader',array('file'=>'aws'.DS.'aws-autoloader.php'));
 App::import('Vendor','aws-autoloader',array('file'=>'aws'.DS.'aws-autoloader.php'));