PHPackages                             g42cloud/g42cloud-sdk-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. g42cloud/g42cloud-sdk-php

ActiveLibrary[HTTP &amp; Networking](/categories/http)

g42cloud/g42cloud-sdk-php
=========================

G42 Cloud SDK for PHP

0.0.8-beta(2y ago)08Apache-2.0PHPPHP &gt;=5.6.0

Since Nov 29Pushed 2y agoCompare

[ Source](https://github.com/g42cloud-sdk/g42cloud-sdk-php)[ Packagist](https://packagist.org/packages/g42cloud/g42cloud-sdk-php)[ RSS](/packages/g42cloud-g42cloud-sdk-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (8)Dependencies (5)Versions (9)Used By (0)

[![](https://camo.githubusercontent.com/183dfdb20934b97c75ad8e0e55867a265f619d01c9192b195bd50ba0cf214c6c/68747470733a2f2f75706c6f61642e77696b696d656469612e6f72672f77696b6970656469612f656e2f7468756d622f392f39342f47726f75705f34325f6c6f676f2e706e672f33333070782d47726f75705f34325f6c6f676f2e706e67)](https://www.g42cloud.com/)

G42 Cloud Php Software Development Kit (Php SDK)
================================================

[](#g42-cloud-php-software-development-kit-php-sdk)

The G42 Cloud Php SDK allows you to easily work with G42 Cloud services such as Elastic Compute Service (ECS) and Virtual Private Cloud(VPC) without the need to handle API related tasks.

This document introduces how to obtain and use G42 Cloud Php SDK.

Requirements
------------

[](#requirements)

- To use G42 Cloud Php SDK, you must have G42 Cloud account as well as the Access Key (AK) and Secret key (SK) of the G42 Cloud account. You can create an AccessKey in the G42 Cloud console.
- To use G42 Cloud Php SDK to access the APIs of specific service, please make sure you do have activated the service in [G42 Cloud console](https://console.g42cloud.com/console/) if needed.
- G42 Cloud Php SDK requires **PHP 5.6** or later, run command `php --version` to check the version of Php.

Install Php SDK
---------------

[](#install-php-sdk)

The recommended way to install SDK is with [Composer](https://getcomposer.org/).

Composer is a dependency management tool for Php which allows you to declare the dependencies your project needs and installs them into your project.

```
# Install Composer
curl -sS https://getcomposer.org/installer | php

# Install the Php SDK
composer require g42cloud/g42cloud-sdk-php:0.0.1-beta
```

After installing, you need to require Composer's autoloader:

```
require 'path/to/vendor/autoload.php';
```

Code example
------------

[](#code-example)

- The following example shows how to query a domains list of CDN in a specific region, you need to substitute your real `{Service}Client` for `CdnClient` in actual use.
- Substitute the values for `{your ak string}`, `{your sk string}`, `{your endpoint string}` and `{your domain id}`.

```
