Install the SDK for PHP

Updated at:

You can install Intelligent Media Services (IMS) SDK for PHP by using Composer or the SDK source code.

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, the dependency is added to the composer.json file. Example:

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

    The preceding dependency version is for reference only. 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. For more information, 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';