Download the PHP package kingsoftcloud/sdk-php without Composer

On this page you can find all versions of the php package kingsoftcloud/sdk-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package sdk-php

简介

欢迎使用金山云开发者工具套件(SDK)。为方便开发者调试和接入金山云产品 API,这里向您介绍适用于 PHP 的金山云开发工具包,并提供首次使用开发工具包的简单示例。让您快速获取金山云 PHP SDK 并开始调用。

依赖环境

  1. PHP 5.6.0 版本及以上
  2. 从控制台 开通相应产品
  3. 获取 SecretID、SecretKey 以及调用地址endpoint,具体参考各产品说明。

    获取安装

    安装 PHP SDK 前,先获取安全凭证。在第一次使用云API之前,用户首先需要在控制台上申请安全凭证,安全凭证包括 SecretID 和 SecretKey, SecretID 是用于标识 API 调用者的身份,SecretKey是用于加密签名字符串和服务器端验证签名字符串的密钥。SecretKey 必须严格保管,避免泄露。

    通过 Composer 安装

    通过 Composer 获取安装是使用 PHP SDK 的推荐方法,Composer 是 PHP 的依赖管理工具,支持您项目所需的依赖项,并将其安装到项目中。关于 Composer 详细可参考 Composer 官网 。

  4. 安装Composer: windows环境请访问Composer官网下载安装包安装。

    unix环境在命令行中执行以下命令安装。

    curl -sS https://getcomposer.org/installer | php

    sudo mv composer.phar /usr/local/bin/composer

  5. 执行命令 composer require kingsoftcloud/sdk-php 添加依赖。
  6. 在代码中添加以下引用代码。注意:如下仅为示例,composer 会在项目根目录下生成 vendor 目录,/path/to/为项目根目录的实际绝对路径,如果是在当前目录执行,可以省略绝对路径。

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

    php_curl 扩展

此 SDK 依赖的 GuzzleHttp 需要开启 php_curl 扩展,查看环境上的 php.ini 环境确认是否已启用,例如在 Linux 环境下,PHP 7.1 版本,托管在 apache 下的服务,可以打开 /etc/php/7.1/apache2/php.ini 中查看 extension=php_curl.dll 配置项是否已被注释,请删除此项配置前的注释符并重启 apache。

现情况不一。可以运行 php -r "echo sys_get_temp_dir();" 打印系统默认临时目录绝对路径,然后在 php.ini 配置 sys_temp_dir 为这个值尝试是否能解决。

示例

参见金山云控制台-API Explorer-对应服务-SDK示例


All versions of sdk-php with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6.0
guzzlehttp/guzzle Version ^6.3 || ^7.0
aws/aws-sdk-php Version ^2.0 || ^3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package kingsoftcloud/sdk-php contains the following files

Loading the files please wait ....