All Products
Search
Document Center

Intelligent Media Services:Install the SDK for PHP

Last Updated:Nov 28, 2024

This topic describes how to install Intelligent Media Services (IMS) SDK for PHP.

Prerequisites

  • PHP 5.3 or later is installed.

  • Composer 2.0 or later is installed.

Install the SDK for PHP

Install the SDK for PHP by using Composer

  1. Run the composer require alibabacloud/ice-20201109 command on the terminal to load the server SDK.

    After the command is run, you can view the version of the dependency in the composer.json file. Sample version:

    {
        "require": {
            "alibabacloud/ice-20201109": "^1.0"
        }
    }
    Note

    The preceding dependency version is only for reference. For more information about how to obtain the latest dependency version, see server SDKs.

  2. Include the autoload.php file in the code.

    require __DIR__ . '/vendor/autoload.php';

Install the SDK for PHP by using the SDK source code

  1. Download and decompress the server SDK package that contains the source code. For more information about how to download the server SDK package, see Server SDK overview.

  2. Run the composer install command on the terminal to install the server SDK.

  3. Include the autoload.php file from the root directory in the code.

    require_once '/path/to/ice-sdk/autoload.php';