This topic describes how to prepare the environment before you use the SDK for PHP to send and subscribe to messages.

Prerequisites

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

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

Install the SDK for PHP

To install the SDK for PHP, perform the following steps:
  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 use Composer to install the SDK for PHP:
    composer install