为 AWS SDK PHP 注册会话处理程序时出错

Error in registering session handler for AWS SDK PHP

我是在 AWS 上部署 php 应用程序的新手,我遇到了 $_SESSION 的问题,所以我尝试使用 DynamoDb 实现保存会话。但是我不断收到此错误:

[11 月 18 日星期一 05:43:57.699008 2019] [php7:error] [pid 3776] [client 122.2.30.250:27863] PHP 致命错误:未捕获错误: Class 'Aws\DynamoDb\Session\SessionHandler' 在 /var/app/current/config.php 中找不到:12\nStack 跟踪:\n#0 /var/app/current/index.php(3 ): include()\n#1 {main}\n 在第 12

行 /var/app/current/config.php 中抛出

这是我的代码:

    <?php
require 'vendor/autoload.php';

use Aws\DynamoDb\DynamoDbClient;
use Aws\DynamoDb\Session\SessionHandler;

$dynamoDb = DynamoDbClient::factory(array(
    'version' => '2012-08-10',
    'region' => 'ap-southeast-1',
));

$sessionHandler = SessionHandler::factory(array(
    'dynamodb_client' => $dynamoDb,
    'table_name'      => 'sessions',
));
$sessionHandler->register();

session_start();
 ?>

我想通了,应该是

use Aws\DynamoDb\SessionHandler;

AWS 指南已过时...