aliyun / aliyun-mns-php-sdk
Aliyun Message and Notification Service SDK for PHP, PHP>=5.5.0
Installs: 251 452
Dependents: 16
Suggesters: 0
Security: 0
Stars: 34
Watchers: 8
Forks: 27
Open Issues: 5
pkg:composer/aliyun/aliyun-mns-php-sdk
Requires
- php: >=5.5.0
- guzzlehttp/guzzle: >=6.0.0
- psr/http-message: ^1.0
Requires (Dev)
This package is auto-updated.
Last update: 2025-10-21 01:46:32 UTC
README
Aliyun MNS Documents: https://www.aliyun.com/product/mns
Aliyun MNS Console: https://mns.console.aliyun.com
Intall Composer
To install composer by following commands, or see composer
curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer
Install & Use
Add require to your composer.json
{
  "require": {
     "aliyun/aliyun-mns-php-sdk": ">=1.0.0"
  }
}
Use Composer to install requires
composer install
Note: php version>=5.5.0, and xml extension of php is required.
Run the Samples
The basic steps are:
- Set AliCloud AK/SK In Env, please see: configure-the-alibaba-cloud-accesskey-environment
- Run (In the SDK root directory):
- CreateQueueAndSendMessage.php: Set the- Endpointat the bottom and Run- php Samples/Queue/CreateQueueAndSendMessage.php.
- CreateTopicAndPushMessageToQueue.php: Set the- Endpointat the bottom and Run- Samples/Topic/CreateTopicAndPushMessageToQueue.php.
- CreateTopicAndPublishMessage.php: Set the- Endpoint,- ipand- portat the bottom and Run- Samples/Topic/CreateTopicAndPublishMessage.php.
- TopicSubscribe.php: Set the- Endpoint,- regionand- accountIdat the bottom and Run- Samples/Topic/TopicSubscribe.php.
 
Run the Tests
The basic steps are:
- Set AliCloud AK/SK/Endpoint In Tests/aliyun-mns.ini.
- In the SDK root directory, run vendor/bin/phpunit.