Skip to content

Latest commit

 

History

History
67 lines (42 loc) · 2.86 KB

1-Installation.md

File metadata and controls

67 lines (42 loc) · 2.86 KB

← Prerequisites | Installation(中文) | Client →


Installation

There are ways to install Alibaba Cloud SDK for PHP:

Before you install ensure your environment is using PHP version 5.5 or later. Learn more about environment requirements and recommendations.

As a dependency via Composer

Composer is the recommended way to install. Composer is a tool for PHP that manages and installs the dependencies of your project. For more information on how to install Composer, configure autoloading, and follow other best practices for defining dependencies, see getcomposer.org.

Install

This repository is the all-in-one SDK of Alibaba Cloud. If you want to install by product sub-package, please refer to: Supported Product List.

If Composer is already installed globally on your system, run the following in the base directory of your project to install Alibaba Cloud SDK for PHP as a dependency:

composer require alibabacloud/sdk

Otherwise, download and install Composer (Windows users please download and run Composer-Setup.exe):

curl -sS https://getcomposer.org/installer | php

Then type this Composer command to install the latest version of the Alibaba Cloud SDK for PHP as a dependency:

php -d memory_limit=-1 composer.phar require alibabacloud/sdk

Some users may not be able to install due to network problems, you can try to switch the Composer mirror.

Add autoloader to your PHP scripts

To utilize the Alibaba Cloud SDK for PHP in your scripts, include the autoloader in your scripts, as follows.

<?php

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

Installing by Using the ZIP file

We strongly recommend that you install with Composer, but also provide a ZIP file with all classes and dependencies for users who cannot use Composer.

Download the source code from releases, and then extract it into your project at a location you choose. Finally, include the autoloader in your scripts, as follows:

<?php

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

← Prerequisites | Installation(中文) | Client →