简体   繁体   中英

Installing Composer with autoload.php and use Aws\* says Class not found

I'm running my php in cli under my user.

I have installed composer and autoloader.php does exist. Under vendor folders and file have been downloaded (autoload.php aws, bin, composer, guzzlehttp, mtdowling and psr)

Now in my php code I do:

// Include the SDK using the Composer autoloader
require 'vendor/autoload.php';

use Aws\Route53\Route53Client;
use Aws\Common\Credentials\Credentials;

$credentials = new Credentials('KEY', 'SECRETKEY');

$client = Route53Client::factory(array(
    'credentials' => $credentials
));

When I run the script I get: PHP Fatal error: Class 'Credentials' not found in /home/user/updatedns.php on line 15

I tried running it a sudo also (in case it needs to write to the directory) and still get this error.

Just found out that use Aws\\Common\\Credentials\\Credentials; is now under use Aws\\Credentials\\Credentials;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM