Install the SDK Package
Updated at:2025-10-16
Install the SDK Package
Runtime environment
The PHP SDK requires PHP version 5.3.2 or later to operate.
Install SDK
- Download the VPC PHP SDK toolkit (ZIP package) from the Official Website.
-
Add the following code in the script file to use the SDK:
Plain Text1include 'BaiduBce.phar'; 2require 'YourConf.php';For detailed configuration of the VPCClient, please refer to the documentation for each resource.
SDK directory structure
Plain Text
1BaiduBce.phar
2└──src
3 └── BaiduBce
4 ├── Auth //BCE signature
5 ├── Exception //BCE client exception
6 ├── Http //BCE HTTP communication
7 ├── Log //BCE log
8 ├── Services
9 │ ├── Acl //ACL main directory, which must be retained
10 │ │ ├── AclClient.php //Acl operation class. All operations can be completed via AclClient class
11 │ │ └── model
12 │ │ └── AclRule.php //AclRule module
13 │ ├── Bcc // Bcc main directory, this directory must be retained
14 │ │ ├── BccClient.php //Bcc operation class. All operations can be completed via BccClient class
15 │ │ └── model
16 │ │ ├── Billing.php //Billing module
17 │ │ └── SecurityGroupRuleModel.php //SecurityGroupRule module
18 │ ├── Blb //Blb main directory, which must be retained
19 │ │ ├── BlbClient.php //Blb operation class. All operations can be completed via BlbClient class
20 │ │ └── model
21 │ │ └── BackendServer.php //BackendServer Module
22 │ ├── Eip //Eip main directory, which must be retained
23 │ │ ├── EipClient.php //Eip operation class. All operations can be completed via EipClient class
24 │ │ └── model
25 │ │ ├── Billing.php //Billing module
26 │ │ └── Reservation.php //Reservation module
27 │ ├── EipGroup //EipGroup main directory, which must be retained
28 │ │ ├── EipGroupClient.php //EipGroup operation class. All operations can be completed via EipGroupClient class
29 │ │ └── model
30 │ │ ├── Billing.php //Billing module
31 │ │ └── Reservation.php //Reservation module
32 │ ├── Nat //NAT main directory, which must be retained
33 │ │ ├── NatClient.php //Nat operation class. All operations can be completed via NatClient class
34 │ │ └── model
35 │ │ ├── Billing.php //Billing module
36 │ │ └── Reservation.php //Reservation module
37 │ ├── PeerConn //PeerCon main directory, which must be retained
38 │ │ ├── PeerConnClient.php //PeerConn operation class, all operations can be completed through the PeerConnClient class
39 │ │ └── model
40 │ │ ├── Billing.php //Billing module
41 │ │ └── Reservation.php //Reservation module
42 │ └── Route //Route main directory, which must be retained
43 │ │ └── RouteClient.php //Route operation class, all operations can be completed through the RouteClient class
44 │ ├── Subnet //Subnet main directory, which must be retained
45 │ │ └── SubnetClient.php //Operation class for Subnet, all operations can be performed via
46 │ └── Vpc //Vpc main directory, which must be retained
47 │ └── VpcClient.php //Operation class for VPC, all operations can be performed via
48 └── Util //BCE common utilities
Uninstall SDK
To uninstall the SDK, delete the phar package used in the script.
