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

Prerequisites

Before you install and use the Alibaba Cloud SDK for PHP, make sure that the following requirements are met:
  • Your system meets the requirements.
  • An Alibaba Cloud account is created and an 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 Alibaba Cloud SDK for PHP 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 Alibaba Cloud SDK for PHP on GitHub

Core library of the Alibaba Cloud SDK for PHP