Before you use SDK for PHP to send and subscribe to messages, you must prepare the environment by following the instructions provided in this topic.

Environment requirements

  • PHP 5.5.0 or later is installed. For more information, visit Install PHP.
  • Composer is installed. For more information, visit Install Composer.

After PHP is installed, you can run the php -v command to view the version of PHP.

Install the SDK

Perform the following steps to install SDK for PHP:
  1. Add the following dependency to the composer.json file in your PHP installation directory:
    {
      "require": {
         "aliyunmq/mq-http-sdk": ">=1.0.3"
      }
    }
  2. Run the following command to install SDK for PHP by using Composer:
composer install