0
我在瀏覽器中打開我的PHP文件時出現服務器錯誤500。嘗試實例化Amazon s3客戶端時出現服務器錯誤500
這是我的config.php文件:
<?php
return [
's3' => [
'key' => 'xxx',
'secret' => 'xxxx',
'region' => 'ap-southeast-1',
'bucket' => 'abc.def'
]
];
?>
的start.php文件:
<?php
require '../vendor/autoload.php';
use Aws\S3\S3Client;
$config = require('config.php');
$s3 = new S3Client([
'region' => $config['s3Client']['region'],
'version' => 'latest',
'credentials' => [
'key' => $config['s3Client']['key'],
'secret' => $config['s3Client']['secret'],
],
]);
?>
我得到一個500錯誤,當我嘗試實例化一個Amazon S3的客戶端。我是PHP和AWS的新手。代碼有什麼問題?
請啓用錯誤報告和檢查什麼是你的錯誤:函數ini_set(「display_errors設置」,1); ini_set('display_startup_errors',1);使用error_reporting(E_ALL);把這個放在PHP文件的開頭。 –