This topic describes the prerequisites for installing PHP SDK. This topic also describes how to install, update, and uninstall the SDK.

Prerequisites

ApsaraVideo VOD is activated. For more information, see Activate ApsaraVideo VOD.

Environment requirement

PHP 5.3 or later is installed. You can run the php -v command to view the current PHP version. For more information about how to install PHP, visit the PHP official website.

Install PHP SDK

  1. Create a folder named aliyun-php-sdk in your PHP project.
  2. Visit aliyun-openapi-php-sdk to download the source code. Decompress the downloaded package and copy the aliyun-php-sdk-core and aliyun-php-sdk-vod folders to the aliyun-php-sdk directory.
Note We recommend that you use SDK for PHP 1.3.8 or later and VOD SDK for PHP 2.15.1 or later.
Directory structure:Directory
Item Description
1 The PHP SDK directory.
2 The application file.
Note In actual practice, replace the Demo.php file in the preceding figure with your actual application file.

Update PHP SDK

If new operations or new features of existing operations are unavailable in the SDK, perform the following steps to update PHP SDK to the latest version:

  1. Open the ChangeLog.txt files in the aliyun-php-sdk-core and aliyun-php-sdk-vod folders. The first lines in the files indicate the SDK for PHP version and the VOD SDK for PHP version.
  2. View the latest version of PHP SDK on the download page.
    VersionVersion
    Note The preceding figure is provided for illustrative purposes only. Download the latest available version.
  3. Visit aliyun-openapi-php-sdk to download the source code. Decompress the downloaded package and copy the aliyun-php-sdk-core and aliyun-php-sdk-vod folders to the aliyun-php-sdk directory.

Uninstall PHP SDK

Delete the local PHP SDK directory.