All Products
Search
Document Center

Object Storage Service:OSS SDK for PHP 1.0

Last Updated:Jun 17, 2025

This topic describes the sample code of OSS SDK for PHP 1.0 in various scenarios.

The latest OSS SDK for PHP 2.0

  • OSS SDK for PHP 2.0 (alibabacloud-oss-php-sdk-v2) is a major rewrite of the OSS SDK for PHP 1.0 (aliyun-oss-php-sdk) code repository.

  • OSS SDK for PHP 2.0 is a new version that simplifies underlying operations such as identity authentication, automatic request retry, and error handling. You can access OSS by calling API operations without complex programming.

  • OSS SDK for PHP 2.0 provides flexible parameter configuration methods and rich advanced operations, such as paginator, transmission managers, and File-like operations. This comprehensively improves development efficiency and experience.

  • Refer to OSS SDK for PHP 2.0 (preview) to learn about how to get started.

Source code

For the source code of OSS SDK for PHP, visit GitHub.

Sample code

OSS SDK for PHP provides a variety of sample code for your reference or use. The following table lists the sample code files provided by OSS SDK for PHP.

Sample code file

Content

Object.php

Operations related to objects, including uploading, downloading, and managing objects. For more information, see Upload objects, Download objects, and Manage objects.

MultipartUpload.php

Multipart upload

Signature.php

Authorized access

Callback.php

Upload callback

Image.php

Image processing

LiveChannel.php

Operations related to LiveChannel.

Bucket.php

Operations related to buckets, including Create buckets, List buckets, and Delete buckets.

BucketLifecycle.php

Operations related to lifecycle management, such as configuring, querying, and deleting lifecycle rules for buckets. For more information, see Manage lifecycle rules.

BucketLogging.php

Operations related to logging, such as configuring, querying, and deleting logging configurations. For more information, see Logging.

BucketReferer.php

Operations related to hotlink protection on buckets, such as configuring, querying, and deleting hotlink protection configurations for buckets. For more information, see Hotlink protection.

BucketWebsite.php

Operations related to static website hosting, such as configuring, querying, and deleting static website hosting configurations for buckets. For more information, see Static website hosting.

BucketCors.php

Operations related to cross-origin resource sharing (CORS), such as configuring, querying, and deleting CORS configurations. For more information, see CORS.

References