<?php require_once '/AliyunOSS/autoload.php'; use OSS\OssClient; use OSS\Core\OssException; $accessKeyId = "<您从OSS获得的AccessKeyId>"; ; $accessKeySecret = "<您从OSS获得的AccessKeySecret>"; $endpoint = "<您选定的OSS数据中心访问域名,例如oss-cn-hangzhou.aliyuncs.com>"; try { $ossClient = new OssClient($accessKeyId, $accessKeySecret, $endpoint); } catch (OssException $e) { print $e->getMessage(); }