doudou1438 2015-04-20 06:53
浏览 120

AWS SDK PHP aws_autoloader.php没有使用ZIP方法正确加载路径

Im using the Zip method with aws-sdk-php and I get an error with my php app when calling ec2client factory object (or the preceding Use clauses, Im not sure...)

require LIBS_PATH . 'aws-sdk-php/aws-autoloader.php';

use Aws\Common\Aws;
use Aws\Common\Enum\Region;
use Aws\Ec2\Ec2Client;

public function createAWSApp($app_id)
{
    // Get users region
    $this->app->aws_region = $this->getUserAWSRegion();

    // Setup the EC2 object
    $this->ec2client = Ec2Client::factory(array(
        //'profile' => '<profile in your aws credentials file>',
        'key' => AWS_ACCESS_KEY_ID,
        'secret' => AWS_SECRET_ACCESS_KEY,
        'region'  => $this->app->aws_region
    ));

...

The app's framework results in error

The file Aws\Ec2\Ec2Client.php is missing in the libs folder.

If I remove the Use clauses and explicitly name the files such as with a require_once :

require LIBS_PATH . 'aws-sdk-php/aws-autoloader.php';

use Aws\Common\Aws;
use Aws\Common\Enum\Region;
//use Aws\Ec2\Ec2Client;
require_once LIBS_PATH . 'aws-sdk-php/Aws/Ec2/Ec2client.php';

public function cr...

I get a similar message but looks like PHP default cannot find file error:

Warning: require_once(libs/aws-sdk-php/Aws/Ec2/Ec2client.php): failed to open stream: No such file or directory

LIBS_PATH is correct and works for other libraries Im using, the aws-sdk-php files are definitely present etc.

Please help...

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 关于#python#的问题:求帮写python代码
    • ¥15 LiBeAs的带隙等于0.997eV,计算阴离子的N和P
    • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
    • ¥15 来真人,不要ai!matlab有关常微分方程的问题求解决,
    • ¥15 perl MISA分析p3_in脚本出错
    • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
    • ¥15 ubuntu虚拟机打包apk错误
    • ¥199 rust编程架构设计的方案 有偿
    • ¥15 回答4f系统的像差计算
    • ¥15 java如何提取出pdf里的文字?