douhe3313 2014-07-18 08:11
浏览 35

sms api使用php无法正常工作,即使它没有错误

I am trying to send SMS using an API its working fine in my local but it is not working in remote server and it s not giving any error also. if any 1 knows the reason for this then please tell me the solution

following code i am using

`function execute($url) {

    $ch=curl_init();
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

    $output=curl_exec($ch);

    curl_close($ch);

    return $output;

}   `
  • 写回答

2条回答 默认 最新

  • douxianxing5712 2014-07-18 08:32
    关注

    You need libcurl library installed on that machine in order to use php-curl extension. Also look in php.ini if you have extension=php_curl.so uncommented. Try to add this code to make sure everything is fine:

        if(function_exists('curl_exec')) {
           echo 'curl is running';
        } else {
           echo 'curl is not running';
        }
    

    Also, don't you have any post fields for the request ? You can do that with CURLOPT_POSTFIELDS. Documentation is here

    评论

报告相同问题?

悬赏问题

  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!