This topic describes how to install and update the server operation SDK for PHP.
Prerequisites
MPS is activated. For more information, see Activate ApsaraVideo Media Processing.
Overview
Alibaba Cloud SDK for PHP is a development kit that enables quick access to Alibaba
Cloud services. The Alibaba Cloud Client for PHP provides underlying support. We recommend that you install the SDK by using Composer.
If you cannot use Composer, you can install the SDK by using a ZIP package.
Note Alibaba Cloud SDK for PHP of the latest version is different from that of the earlier
version in terms of installation and usage. Read the following sections to learn more
about the installation and the usage. For more information, see Alibaba Cloud SDK for PHP.
Environment requirements
- Requirements
- PHP 5.5.0 or later is installed.
Note You can run the
php -vcommand to view the current PHP version. If you need to install PHP, visit the PHP official website. - Composer is used and the
composer dump-autoload --optimizecommand is run. - If you use a RsaKeyPair client that is supported only on the Alibaba Cloud Japan site, OpenSSL PHP is enabled.
- PHP 5.5.0 or later is installed.
- Suggestions
Install the SDK by using Composer (Recommended)
Composer is a dependency manager for PHP. For more information about how to install Composer, configure autoloading, and follow other best practices for defining dependencies, visit the Composer page.
Install the SDK by using a ZIP package
If Composer is unavailable, you can download a ZIP package that contains all classes and dependencies. For more information about the download link, see Installation.
Download the ZIP package, decompress it in the specified directory of the project,
and then include the autoloader in your script. The following sample code provides
an example:
<?php
require __DIR__ . '/vendor/autoload.php';Update the SDK
If new operations or new features of existing operations are unavailable in the current
SDK version, update the SDK to the latest version. The following sample code provides
an example:
php -d memory_limit=-1 composer.phar require alibabacloud/sdk