$ url ='http://103.xx.xxx.xx:8085/MessagingGateway/SendTransSMS?Username='。$ smsUserName。' & Password ='。$ smsUserPass。' & MessageType = txt & Mobile ='。$ mobile。' & SenderID ='。$ senderID。' & Message ='。$ message;Curl请求失败错误“无法连接到103.xx.xxx.xx端口8085:连接被拒绝”
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
$result = curl_exec($ch);
$error = curl_error($ch);
curl_close($ch);
return response()->json(['status'=>'success', 'msg'=>$result, 'url' =>$url]);
相同的代码在localhost xampp服务器上工作,但它不工作godaddy共享主机。
错误显示:“无法连接到103.xx.xxx.xx端口8085:连接被拒绝”。请告诉我我做错了什么?
您要求curl连接到没有任何内容正在侦听的IP地址和TCP端口... –