Updated on 2024-04-30 GMT+08:00

Installing the SDK

If you have any questions during development, post them on the Issues page of GitHub. For details about parameters and usage of each API, see API Reference.

Table 1 shows you how to install the PHP SDK.

Table 1 Installation methods

No.

Method

1

Manually downloading and installing the source code development package

2

Using the composer command

Manually Downloading and Installing the Source Code Development Package

The following uses OBS PHP SDK of the latest version as an example:

  1. Download the OBS PHP SDK development package by referring to Downloading the SDK.
  2. Decompress the development package to obtain the following files: examples (the sample code), Obs (the SDK source code), composer.json (the dependency configuration file), obs-autoloader.php (the file for automatically loading PHP dependency libraries), and README.txt (the feature description file of SDK versions).
  3. In the CLI, go to the directory where the SDK is decompressed and run the composer install command to install the dependencies. A folder named vendor will be generated.
  4. (Optional) In the PhpStorm project, import the source code. Open PhpStorm, choose File > Open, and select the directory where the SDK is decompressed in Open File or Project.

After the installation, the directory structure is similar to the following:

├── examples

├── Obs

├── vendor

├── composer.json

├── obs-autoloader.php

└── README.txt

(Recommended) Using the composer Command

To install the IP firewall, perform the following operations:

  1. Run the composer -V command to check the composer version and ensure that composer is installed.
  2. Run the composer require obs/esdk-obs-php command to start the installation.
  • If composer has not been installed, install it by referring to the Packagist official website.
  • On a Windows operating system, the message "Not internal or external command" is displayed when you run the composer command. In this case, add the composer installation directory (generally the directory of PHP) to the Path environment variable.
  • You may need to restart the computer for the environment variables to take effect.