>php教程 >php手册 >PHP应用访问Azure中国区存储服务

PHP应用访问Azure中国区存储服务

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB원래의
2016-06-06 19:52:561334검색

Windows Azure官方文档介绍了如何在PHP代码中安装Azure SDK并访问Azure存储: http://www.windowsazure.com/en-us/Documentation/Articles/storage-php-how-to-use-blobs/?fb=zh-cn 其中,获取BLOB引用的办法为: $connectionString = 'DefaultEndpointsProt

Windows Azure官方文档介绍了如何在PHP代码中安装Azure SDK并访问Azure存储:

http://www.windowsazure.com/en-us/Documentation/Articles/storage-php-how-to-use-blobs/?fb=zh-cn


其中,获取BLOB引用的办法为:

$connectionString = 'DefaultEndpointsProtocol=[http|https];AccountName=[yourAccount];AccountKey=[yourKey]'


// Create blob REST proxy.
$blobRestProxy = ServicesBuilder::getInstance()->createBlobService($connectionString);

如果要连接国内,我们可以修改connectionstring为
$connectionString = "<span>BlobEndpoint=https://[yourAccount].blob.core.chinacloudapi.cn/;QueueEndpoint=https://[yourAccount].queue.core.chinacloudapi.cn/;TableEndpoint=https://[yourAccount].table.core.chinacloudapi.cn/</span>;DefaultEndpointsProtocol=[http|https];AccountName=[yourAccount];AccountKey=[yourKey]
]";

也就是在连接字符串中加入每个存储服务的端点URL,然后就可以访问国内的存储了。


另外,Azure的PHP SDK源代码在https://github.com/WindowsAzure/azure-sdk-for-php。有兴趣的用户可以自己查看下源码

PHP应用访问Azure中国区存储服务

성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.