PHP cURL如何检查我的请求是否被阻止?

PHP cURL如何检查我的请求是否被阻止?,php,web-services,curl,Php,Web Services,Curl,我在这个asmx URL上使用cURL: 在localhost中成功,但当我将文件上载到live server时,它将返回bool(false) 然而,我尝试将提交URL和请求更改为其他asmx URL,我尝试了,并且它在localhost和live server上工作 这是否意味着我的连接被阻止了?无论如何,我可以检查并确认这一点吗 curl\u获取信息结果: $xml_data = '<?xml version="1.0" encoding="utf-8"?> <soap:

我在这个asmx URL上使用cURL: 在localhost中成功,但当我将文件上载到live server时,它将返回bool(false)

然而,我尝试将提交URL和请求更改为其他asmx URL,我尝试了,并且它在localhost和live server上工作

这是否意味着我的连接被阻止了?无论如何,我可以检查并确认这一点吗

curl\u获取信息结果:

$xml_data = '<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
   <SendRequest xmlns="http://tempuri.org/">
     <ResellerAccount>*******</ResellerAccount>
     <RefNum>******</RefNum>
   </SendRequest>
</soap:Body>
</soap:Envelope>';

$URL = "http://ltcmobile.webhop.biz:2016/ereloadws/service.asmx";

$ch = curl_init($URL);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml; charset=utf-8'));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $xml_data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
curl_close($ch);

var_dump($output);
本地主机: 数组([url]=>[content\u type]=>text/xml;字符集=utf-8[http\u code]=>200[header\u size]=>230[request\u size]=>525[filetime]=>1[ssl\u-verify\u-result]=>0[redirect\u-count]=>0[total\u-time]=>0.109[namelookup\u-time]=>0[connect\u-time]=>0.063[pretransfer\u-time]=>0.063[size\u-upload]=>393[size\u-download\u]下载速度=>479]=>4394[上传速度]=>3605[下载内容长度]=>479[上传内容长度]=>393[开始传输时间]=>0.109[重定向时间]=>0[重定向url]=>0[主ip]=>175.139.27.203[认证信息]=>Array()[主端口]=>2016[本地ip]=>192.168.1.102[本地端口]=>52286)

实时服务器: 数组([url]=>[content\u type]=>[http\u code]=>0[header\u size]=>0[filetime]=>1[ssl\u verify\u result]=>0[redirect\u count]=>0[total\u time]=>0[namelookup\u time]=>9.7E-5[connect\u time]=>0[pretransfer\u time]=>0[size\u upload]=>0[size\u download]=>0[size\u download]=>0[speed\u download]=>0[speed\u download]=>[下载内容长度]=>-1[上传内容长度]=>-1[开始传输时间]=>0[重定向时间]=>0[重定向url]=>[主ip]=>175.139.27.203[认证信息]=>Array())

curl调用:

$xml_data = '<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
   <SendRequest xmlns="http://tempuri.org/">
     <ResellerAccount>*******</ResellerAccount>
     <RefNum>******</RefNum>
   </SendRequest>
</soap:Body>
</soap:Envelope>';

$URL = "http://ltcmobile.webhop.biz:2016/ereloadws/service.asmx";

$ch = curl_init($URL);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml; charset=utf-8'));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $xml_data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
curl_close($ch);

var_dump($output);
$xml\u data=”
*******
******
';
$URL=”http://ltcmobile.webhop.biz:2016/ereloadws/service.asmx";
$ch=curl\u init($URL);
curl_setopt($ch,CURLOPT_HTTPHEADER,array('Content-Type:text/xml;charset=utf-8');
卷曲设置($ch,卷曲设置桩,1);
curl_setopt($ch,CURLOPT_POSTFIELDS,$xml_data);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
$output=curl\u exec($ch);
卷曲关闭($ch);
变量转储(输出);

提前感谢!

根据您的curl\u getinfo输出,您的服务器端请求似乎没有运行。另外,请查看curl\u error to,查看它对此的说明


您的服务器可能存在出站通信问题。您的服务器上的2016出站端口是否打开?您可以(从服务器)ping 175.139.27.203?

可能有很多原因。开始调查的一个好方法是实际查看可用的curl信息。查看此处了解详细信息。这可能会给您一个提示,告诉您在哪里继续调查。您好@YvesLeBorg我用curl\u getinfo结果编辑我的问题,谢谢!!您的服务器请求看起来不像它正在移动。尝试查看curl_error to,看看它是怎么说的。您的服务器上是否打开了2016端口出站?您可以(从服务器)ping
175.139.27.203
?要做的事情太多,时间太少。:)Hi@YvesLeBorg尝试了curl_error,返回“无法连接到主机”关于ping,我将请求我的主机并向您更新;)请发布您用于进行curl调用的完整代码。这就是问题所在,我只知道这意味着我们的主机还需要打开端口2016,同时我还学习使用curl\u getinfo和curl\u error非常感谢!!