Installation
Last Updated:2020-07-20
Runtime Environment
- Runtime environment The PHP SDK package requires an Runtime environment of at least PHP 5.3.2.
-
Entitlements and authentication To use Baidu AI Cloud products, you need to have a Baidu AI Cloud account and a valid AK (Access Key) and SK (Secret Key) for signature verification.
You can obtain and understand your AK/SK information through the following steps:
- [Register Baidu AI Cloud Account](https://login.bce.baidu.com/reg.html? tpl=bceplat&from=portal)
- [Create AK/SK](https://console.bce.baidu.com/iam/? _=1513940574695#/iam/accesslist)
Install SDK
- Download the Java SDK compression toolkit at Official Website.
- There are three files after decompressing the ZIP package, as follows:
BaiduBce.phar //PHP SDK
BlbClient.php //Example
SampleConf.php //See configuration file; see below for details
- Add the following code to the script file and you can use the SDK package:
include 'BaiduBce.phar';
require 'YourConf.php';
For a reference to the configuration file, please see Configuring BlbClient below.
SDK's Directory Structure
BaiduBce.phar
├──src
│ └── BaiduBce
│ ├── Auth //BCE signature related
│ ├── Exception //BCE client exception
│ ├── Http //BCE's Http communication related
│ ├── Log //BCE log
│ ├── Services
│ │ └── Blb //BLB home directory which must be kept
│ │ ├── BlbClient.php //BLB operation class (all operations can be completed through the BlbClient class)
│ └── Util //BCE utility
└──vendor //Third-party libraries
Uninstall SDK
It is expected that you delete the phar package of include in the script when uninstalling the SDK.