Home  >  Article  >  php教程  >  Aliyun OSS for PHP开发笔记(一):OssClient初始化

Aliyun OSS for PHP开发笔记(一):OssClient初始化

WBOY
WBOYOriginal
2016-06-02 09:14:141692browse
跳至 [1] [全屏预览]
<?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();
}
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn