Skip to content

Latest commit

 

History

History
53 lines (38 loc) · 2.43 KB

1-Installation.md

File metadata and controls

53 lines (38 loc) · 2.43 KB

← Prerequisites | Installation(中文) | Client →


Installation

There are ways to install Alibaba Cloud Client 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.

Installation

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

composer require alibabacloud/client

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 Client for PHP as a dependency:

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

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 Client 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 .zip file, 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 →