Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/231.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 无法连接到rslr.connectbind.com端口8080:连接被拒绝_Php - Fatal编程技术网

Php 无法连接到rslr.connectbind.com端口8080:连接被拒绝

Php 无法连接到rslr.connectbind.com端口8080:连接被拒绝,php,Php,PHP CURL拒绝打开连接 当我在浏览器上调用此url时,它会打开并发送短信 响应正常:1701 | 254719401837 | e8fbf5af-d7c2-4f34-a80f-94803ffee9d5 当我试着用curl来称呼它的时候 $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_PORT => "8080", CURLOPT_URL => "http://rslr.connectbind.com:8

PHP CURL拒绝打开连接

当我在浏览器上调用此url时,它会打开并发送短信

响应正常:1701 | 254719401837 | e8fbf5af-d7c2-4f34-a80f-94803ffee9d5

当我试着用curl来称呼它的时候

$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://rslr.connectbind.com:8080/bulksms/bulksms?
username=josy-
mbongocash&password=kipese73&type=0&dlr=1&destination=254719401837&
source=MbongoCash&message=METHODE-PATRICK",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"Postman-Token: 09ba239d-fcb7-4755-8032-7ff4f768147f",
"cache-control: no-cache"
),
));
 $response = curl_exec($curl);
 $err = curl_error($curl);

 curl_close($curl);

 if ($err) {
 echo "cURL Error #:" . $err;
} else {
echo $response;
}

响应:无法连接到rslr.connectbind.com端口8080:连接被拒绝

问题在于我更改了端口,并且它与CURL一起工作

$url="http://rslr.connectbind.com/bulksms/bulksms";
$ch = curl_init();

$variables = array(
    'username' => 'Your user name',
    'password' => 'Your password',
    'type' => '0',
    'dlr' => '1',
    'destination' => "Mobile number with country code", 
    'source' => 'Brand Name',
    'message' => "sms",
);

curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0);
curl_setopt($ch, CURLOPT_POSTFIELDS, $variables);

echo $result = curl_exec($ch);
没有卷曲

$url="http://rslr.connectbind.com/bulksms/bulksms";
$variables = array(
    'username' => 'Your user name',
    'password' => 'Your password',
    'type' => '0',
    'dlr' => '1',
    'destination' => "Mobile number with country code", 
    'source' => 'Brand Name',
    'message' => "sms",
);

$options = array(
    'http' => array(
        'header'  => "Content-type: application/x-www-form-urlencoded\r\n",
        'method'  => 'POST',
        'content' => http_build_query($variables),
    ),
);


$context  = stream_context_create($options);
echo $result = file_get_contents($url, false, $context);

首先,不确定该站点如何工作,但要确保您知道您的登录名/密码在其中。请避免在stack-overflow上发布您的个人登录名详细信息,如用户名和密码。您可以更具体地说明您更改了什么端口吗?该服务遇到了类似的问题。