发送不出验证码,报错undefined curl_init()

来源:7-9 基于阿里短信服务发送第一个短信验证码demo

guofengio

2018-04-15

misswell@ubuntu:~/Code/thinkphp_5.1.0_rc/server$ php http_server.php 

PHP Fatal error:  Uncaught Error: Call to undefined function Aliyun\Core\Http\curl_init() in /home/misswell/Code/thinkphp_5.1.0_rc/extend/ali/lib/Core/Http/HttpHelper.php:13

Stack trace:

#0 /home/misswell/Code/thinkphp_5.1.0_rc/extend/ali/lib/Core/DefaultAcsClient.php(60): Aliyun\Core\Http\HttpHelper::curl('http://dysmsapi...', 'POST', Array, Array)

#1 /home/misswell/Code/thinkphp_5.1.0_rc/extend/ali/lib/Core/DefaultAcsClient.php(22): Aliyun\Core\DefaultAcsClient->doActionImpl(Object(Aliyun\Api\Sms\Request\V20170525\SendSmsRequest), Object(Aliyun\Core\Auth\ShaHmac1Signer), Object(Aliyun\Core\Auth\Credential), true, 3)

#2 /home/misswell/Code/thinkphp_5.1.0_rc/application/common/lib/ali/Sms.php(102): Aliyun\Core\DefaultAcsClient->getAcsResponse(Object(Aliyun\Api\Sms\Request\V20170525\SendSmsRequest))

#3 /home/misswell/Code/thinkphp_5.1.0_rc/application/index/controller/Index.php(25): app\common\lib\ali\Sms::sendSms(18624395279, 12345)

#4 [internal function]: app\index\controller\Index->sms()

#5 /home/misswell/Code/thinkphp_5.1.0 in /home/misswell/Code/thinkphp_5.1.0_rc/extend/ali/lib/Core/Http/HttpHelper.php on line 13



                                                                               

  [think\exception\ErrorException]                                             

  Uncaught Error: Call to undefined function Aliyun\Core\Http\curl_init() in   

  /home/misswell/Code/thinkphp_5.1.0_rc/extend/ali/lib/Core/Http/HttpHelper.p  

  hp:13                                                                        

  Stack trace:                                                                 

  #0 /home/misswell/Code/thinkphp_5.1.0_rc/extend/ali/lib/Core/DefaultAcsClie  

  nt.php(60): Aliyun\Core\Http\HttpHelper::curl('http://dysmsapi...', 'POST',  

   Array, Array)                                                               

  #1 /home/misswell/Code/thinkphp_5.1.0_rc/extend/ali/lib/Core/DefaultAcsClie  

  nt.php(22): Aliyun\Core\DefaultAcsClient->doActionImpl(Object(Aliyun\Api\Sm  

  s\Request\V20170525\SendSmsRequest), Object(Aliyun\Core\Auth\ShaHmac1Signer  

  ), Object(Aliyun\Core\Auth\Credential), true, 3)                             

  #2 /home/misswell/Code/thinkphp_5.1.0_rc/application/common/lib/ali/Sms.php  

  (102): Aliyun\Core\DefaultAcsClient->getAcsResponse(Object(Aliyun\Api\Sms\R  

  equest\V20170525\SendSmsRequest))                                            

  #3 /home/misswell/Code/thinkphp_5.1.0_rc/application/index/controller/Index  

  .php(25): app\common\lib\ali\Sms::sendSms(18624395279, 12345)                

  #4 [internal function]: app\index\controller\Index->sms()                    

  #5 /home/misswell/Code/thinkphp_5.1.0                                        

                                                                               



Exception trace:

 () at /home/misswell/Code/thinkphp_5.1.0_rc/extend/ali/lib/Core/Http/HttpHelper.php:13

 think\Error::appShutdown() at n/a:n/a




Fatal error: Uncaught Error: Call to undefined function Aliyun\Core\Http\curl_init() in /home/misswell/Code/thinkphp_5.1.0_rc/extend/ali/lib/Core/Http/HttpHelper.php:13

Stack trace:

#0 /home/misswell/Code/thinkphp_5.1.0_rc/extend/ali/lib/Core/DefaultAcsClient.php(60): Aliyun\Core\Http\HttpHelper::curl('http://dysmsapi...', 'POST', Array, Array)

#1 /home/misswell/Code/thinkphp_5.1.0_rc/extend/ali/lib/Core/DefaultAcsClient.php(22): Aliyun\Core\DefaultAcsClient->doActionImpl(Object(Aliyun\Api\Sms\Request\V20170525\SendSmsRequest), Object(Aliyun\Core\Auth\ShaHmac1Signer), Object(Aliyun\Core\Auth\Credential), true, 3)

#2 /home/misswell/Code/thinkphp_5.1.0_rc/application/common/lib/ali/Sms.php(102): Aliyun\Core\DefaultAcsClient->getAcsResponse(Object(Aliyun\Api\Sms\Request\V20170525\SendSmsRequest))

#3 /home/misswell/Code/thinkphp_5.1.0_rc/application/index/controller/Index.php(25): app\common\lib\ali\Sms::sendSms(18624395279, 12345)

#4 [internal function]: app\index\controller\Index->sms()

#5 /home/misswell/Code/thinkphp_5.1.0 in /home/misswell/Code/thinkphp_5.1.0_rc/extend/ali/lib/Core/Http/HttpHelper.php on line 13

[2018-04-15 11:30:38 *52064.3] ERROR zm_deactivate_swoole (ERROR 503): Fatal error: Uncaught Error: Call to undefined function Aliyun\Core\Http\curl_init() in /home/misswell/Code/thinkphp_5.1.0_rc/extend/ali/lib/Core/Http/HttpHelper.php:13

Stack trace:

#0 /home/misswell/Code/thinkphp_5.1.0_rc/extend/ali/lib/Core/DefaultAcsClient.php(60): Aliyun\Core\Http\HttpHelper::curl('http://dysmsapi...', 'POST', Array, Array)

#1 /home/misswell/Code/thinkphp_5.1.0_rc/extend/ali/lib/Core/DefaultAcsClient.php(22): Aliyun\Core\DefaultAcsClient->doActionImpl(

[2018-04-15 11:30:38 $52058.0] WARNING swManager_check_exit_status: worker#3 abnormal exit, status=255, signal=0


写回答

1回答

singwa

2018-04-15

你好,你需要安装curl扩展

0
3
singwa
回复
guofengio
解决 了 就好。赞。
2018-04-15
共3条回复

Swoole入门到实战打造高性能赛事直播平台

swoole创始人推荐,借助Swoole打造高性能直播平台

2228 学习 · 1062 问题

查看课程