This topic describes how to use the server SDK for PHP provided by ApsaraVideo Live.


PHP 5.5.0 or later is installed.


  1. Log on to the server.
  2. Install ApsaraVideo Live SDK.

    composer require alibabacloud/live

    Note If the installation fails due to network issues, you can install Alibaba Cloud Composer Mirror. For more information, see Alibaba Cloud Composer Mirror.
  3. Initiate the client.
    use AlibabaCloud\Client\AlibabaCloud;
    AlibabaCloud::accessKeyClient('accessKeyId', 'accessKeySecret')->asDefaultClient();
  4. Call an operation by using the Remote Procedure Call (RPC) style. In this example, the DescribeCdnService operation is called.
    use AlibabaCloud\Client\AlibabaCloud;
    use AlibabaCloud\Client\Exception\ClientException;
    use AlibabaCloud\Client\Exception\ServerException;
    try {
        $result = AlibabaCloud::rpc()
    } catch (ClientException $exception) {
    } catch (ServerException $exception) {

    For more information, see API overview.