Reoss php sdk的问题
用的是iwebshop的开源项目
require_once __DIR__ . '/../../oss/autoload.php';
use OSS\OssClient;
use OSS\Core\OssException;
class App extends IController
{
public $layout='';
function init()
{
CheckRights::checkUserRights();
}
public function upload_test()
{
$accessKeyId = "GcIU9CcIhqqW0Wmu";
$accessKeySecret = "kcf2Fo5DEkfESYfGTCCyY3SnOoADZL";
$endpoint = "oss-cn-shanghai.aliyuncs.com";
$bucket= "bxspic";
$object = "bxspic.jpg";
$content = "Hi, OSS.";
try {
$ossClient = new OssClient($accessKeyId, $accessKeySecret, $endpoint);
$ossClient->putObject($bucket, $object, $content);
} catch (OssException $e) {
print $e->getMessage();
echo $e;
}
}
大概是这样的代码,不知道能说清楚不?
-------------------------
Reoss php sdk的问题
多谢提醒啊 问题应该出现在new那一行
-------------------------
Reoss php sdk的问题
确实是命名空间的问题,现在是没有the class name is inaccurate的问题了,但是执行到$ossClient = new OssClient($accessKeyId, $accessKeySecret, $endpoint); 这一句,就会出现500的internal server error,这是怎么回事啊?