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 the API Reference

(Recommended) Installing the SDK Using composer

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.
  • If a network fault occurs when you use Composer to install dependencies, you can use the image source for the Chinese region to run the composer config -g repositories.packagist composer http://packagist.phpcomposer.com CLI command, to rectify the fault.

Installing the SDK Using Source Codes

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 folder examples (sample code), folder Obs (SDK source code), file composer.json (dependency configuration file), file obs-autoloader.php (file used to automatically load the PHP dependent libraries), file README.txt (feature description file of SDK versions), and file vendor.zip (open-source dependent libraries pre-downloaded for the SDK).
  3. Install the dependent libraries using either of the following methods:

    1. On the command-line interface (CLI), go to the directory where the development package is decompressed, run the composer install command to install the dependencies. A folder named vendor will be generated.
    2. Directly decompress vendor.zip to the directory where the development package is decompressed, and ensure the vendor folder and the Obs folder are stored in directories at the same level.

  4. Delete the vendor.zip package.
  5. (Optional) On Eclipse, import the source code to the PHP project. Open Eclipse PHP IDE and choose Import > Projects from Folder or Archive. Set Import source to the directory where the development package is decompressed.

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

├── examples

├── Obs

├── vendor

├── composer.json

├── obs-autoloader.php

└── README.txt