我该如何克服我的服务器拒绝连接的问题

问题描述

我写了一个curl代码来运行SMS API。它在本地主机上运行良好。当我将其上传到虚拟主机时,它显示错误,例如 无法连接到smeapps.mobitel.lk端口8585:连接被拒绝

我不知道该怎么解决?

这是我写的代码。

<?php
// Your ID and token

//Content-Type: application/json
 //Accept: application/json
//header('Content-Type: application/json');
//header('Accept: application/json');

$blogID = 'xxxxxx';
$authToken = 'xxxxx';

// The data to send to the API
$postData = array(
    'username' => 'xxxxx','password' => 'xxxx','from' => 'xxxx','to' => '07612xxxxx','text'=>'hello','messageType'=>0
);





// Setup cURL
$ch = curl_init('http://smeapps.mobitel.lk:8585/EnterpriseSMSV3/esmsproxyURL.php');
curl_setopt_array($ch,array(
    CURLOPT_POST => TRUE,CURLOPT_RETURNTRANSFER => TRUE,CURLOPT_HTTPHEADER => array(
        'Authorization: '.$authToken,'Content-Type: application/json','Accept: application/json'
    ),CURLOPT_POSTFIELDS => json_encode($postData)
));

// Send the request
$response = curl_exec($ch);

// Check for errors
if($response === FALSE){
    die(curl_error($ch));
}

// Decode the response
$responseData = json_decode($response,TRUE);

// Print the date from the response
//echo $responseData['published'];

?>

代码中也提到了链接。有人可以帮我解决吗?

谢谢。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

依赖报错 idea导入项目后依赖报错,解决方案:https://blog....
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下...
错误1:gradle项目控制台输出为乱码 # 解决方案:https://bl...
错误还原:在查询的过程中,传入的workType为0时,该条件不起...
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct...