This topic describes how to add dependencies to install Alibaba Cloud SMS SDK for PHP.

Prerequisites

Before you install and use the PHP SDK, the Alibaba Cloud account is created and the AccessKey pair is created. For more information, see Create an AccessKey pair.

Note We recommend that you use the Transport Layer Security (TLS) protocol for compilation at the backend and use the PHP cURL extension. We recommend that you use cURL 7.16.2 and later.

Procedure

To install dependencies by using the Composer dependency manager, perform the following operation:

If Composer has been installed globally in your system, run the following command in your project directory to add the Alibaba Cloud Client for PHP library as a dependency.
composer require alibabacloud/client

For more information about Composer and other installation methods, see Installation guide.

After the PHP SDK is installed, you can use OpenAPI Explorer to generate the sample code of API operations for the SDK, and apply the sample code in your projects. For more information, see Installation and usage guide.

Core library of the PHP SDK on GitHub

Core library of the PHP SDK