- Documentation
Torch Object Storage
SDK Reference
PHP
Install PHP SDK
Install PHP SDK
This article explains how to install the TOS PHP SDK.
Environment
- The TOS PHP SDK supports PHP version 5.6 and above; this document uses PHP 5.6 as an example.
tip
Since TOS provides an HTTP protocol interface, your PHP environment needs to enable the cURL and OpenSSL extensions through php.ini to send HTTP or HTTPS requests.
- Supported operating systems: Linux, macOS, and Windows.
Source code download
- For the TOS PHP SDK source code, see: GitHub.
Installation methods
You can install the SDK using the following methods:
(Recommended) Use PHP's package manager composer
warning
composer version V1 stopped supporting on September 1, 2025; please use composer version V2.
- Run the following command to upgrade Composer from V1.x to V2.x.
- Directly run composer require volcengine/ve-tos-php-sdk, or add the following dependency in composer.json and then run composer install.
- After successful installation, TOS PHP SDK will be included in the vendor/ directory; you can import dependencies in your code as follows.
Use the phar file of TOS PHP SDK
- Select the corresponding version on GitHub and directly download the packaged phar file.
- Import dependencies in your code as follows.
Use TOS PHP SDK source code
- Select the corresponding version on GitHub and download the source code directly.
- After downloading, the TOS PHP SDK source code includes the autoload.php file, which can be used to include dependencies in the code as follows.
Last updated: 2026.01.14 17:13:15