初始化 使用SDK功能前,需要新建s3Client,代码如下: php require '/path/to/autoload.php'; use AwsS3S3Client; use AwsExceptionAwsException; use AwsCredentialsCredentials; const endpoint ' '; // e.g. or const accesskey ' '; const secretkey ' '; $credentials new Credentials(accesskey, secretkey); $s3Client new S3Client([ 'region' > 'ctyun', // region固定填ctyun 'version' > '20060301', // s3接口版本号,固定填20060301 'credentials' > $credentials, 'endpoint' > endpoint, ]); 参数说明: 参数 说明 是否必要 accesskey 用户账号 access key 是 secretkey 用户账号 secret key 是 endpoint 天翼云资源池的地址,必须指定http或https前缀 是