PHPackages                             suhaoxiang/aliyun-dysms-php-sdk - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. suhaoxiang/aliyun-dysms-php-sdk

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

suhaoxiang/aliyun-dysms-php-sdk
===============================

Aliyun SMS SDK for PHP

1.0(8y ago)0269Apache-2.0PHPPHP &gt;=5.5.0

Since Dec 21Pushed 8y ago1 watchersCompare

[ Source](https://github.com/suhaoxiang/aliyun-dysms-php-sdk)[ Packagist](https://packagist.org/packages/suhaoxiang/aliyun-dysms-php-sdk)[ Docs](https://www.aliyun.com/product/sms)[ RSS](/packages/suhaoxiang-aliyun-dysms-php-sdk/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

aliyun-dysms-php-sdk
====================

[](#aliyun-dysms-php-sdk)

> 安装方法

```
composer install suhaoxiang/aliyun-dysms-php-sdk

```

> 使用方法

```
	use Aliyun\Core\Config as AliyunConfig;
	use Aliyun\Core\Profile\DefaultProfile;
	use Aliyun\Core\DefaultAcsClient;
	use Aliyun\Api\Sms\Request\V20170525\SendSmsRequest;
	use Aliyun\Api\Sms\Request\V20170525\QuerySendDetailsRequest;

	$mobile='xxxxxx';	//电话号码

	$appKey = '';		//app key
	$appSecret = '';	//app secret
	$signName  = '';	//前面
	$template_code = '';//模板名称
	$json_string_param = json_encode(Array(
	    "code"=>rand(100000,999999)
	));

	AliyunConfig::load();
	$profile = DefaultProfile::getProfile("cn-hangzhou", $appKey, $appSecret);
	DefaultProfile::addEndpoint("cn-hangzhou", "cn-hangzhou", "Dysmsapi", "dysmsapi.aliyuncs.com");
	$acsClient = new DefaultAcsClient($profile);
	$request = new SendSmsRequest();
	$request->setPhoneNumbers($mobile);
	$request->setSignName($signName);
	$request->setTemplateCode($template_code);
	if(!empty($json_string_param)) {
	    $request->setTemplateParam($json_string_param);
	}

	$acsResponse =  $acsClient->getAcsResponse($request);

	if($acsResponse && strtolower($acsResponse->Code) == 'ok')
	{
	    return ['code'=>1,"msg"=>"发送短信验证码成功"];
	}
	return ['code'=>0,"msg"=>"发送短信验证码失败"];

```

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3114d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4a7731668d6d27c7f7061a62952b737ebae8d2ae8e2e51dce5a567f0b11f2554?d=identicon)[qiandutianxia](/maintainers/qiandutianxia)

---

Tags

sdksmsaliyun

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/suhaoxiang-aliyun-dysms-php-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/suhaoxiang-aliyun-dysms-php-sdk/health.svg)](https://phpackages.com/packages/suhaoxiang-aliyun-dysms-php-sdk)
```

###  Alternatives

[saviorlv/yii2-dysms

Aliyun SMS SDK for Yii2

1316.8k1](/packages/saviorlv-yii2-dysms)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
