本文介绍了找不到AWS开发工具包PHP类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我将AWS开发工具包与php一起使用时,出现一条错误,指出找不到该类.

When I am use the AWS SDK with php I get an error stating that the class cannot be found.

    <?php
    require_once  '/var/www/html/aws.phar';
    use Aws\Common\Aws;
    use Aws\Common\Enum\Region;
    echo "test";
    $AWSregion = Region::US_EAST_1;

    $aws = Aws\Common\Aws::factory(array('key'=>'key', 'secret' => 'secret_key', 'region' => $AWSregion));
    $client = $aws->get('Sqs');

?>

我收到的确切错误消息是PHP致命错误:在/var/www/html/sendSQS.php中找不到类'Aws \ Common \ Enum \ Region'

The exact error message I receive is PHP Fatal Error: Class 'Aws\Common\Enum\Region' not found in /var/www/html/sendSQS.php

感谢您的帮助.

谢谢!

推荐答案

我在wordpress中使用sdk时遇到了同样的问题.我通过composer安装了sdk,但sdk无法正常工作.请尝试zip版本,并在"aws-autoloader.php"中包含sdk. https://github.com/aws/aws-sdk-php/releases

I had same issue with using sdk in wordpress.I installed sdk via composer,but sdk won't work.Please try zip version,and include sdk by "aws-autoloader.php".https://github.com/aws/aws-sdk-php/releases

这篇关于找不到AWS开发工具包PHP类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-26 08:44