douyanguo7964 2014-05-10 08:03
浏览 80

Curl无法在IIS 7.5 windows server 2008 r2中从php调用ashx

I am trying to invoke ashx file from php file say index.php using curl. The url used is

http://example.com/forms/YYY.ashx
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_VERBOSE, false);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$ret = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_HTTP_CODE);

if ($ret === false) {
    echo curl_error($ch);
  //die(curl_error($ch));
}

curl_close($ch);
return $ret;

When i run this, i get $ret as false, curl_error as null [empty] and curl_getinfo($ch, CURLINFO_HTTP_CODE) as 0. Its not hitting the URL only i guess

Can you guys please help me to identify the issue with this

Other Info:

  1. Using IIS 7.5 with windows server 2008 r2 as OS
  2. Installed php 5.3.28 version with curl enabled in php.ini file.
  3. Extension_dir is set to path C:\Program Files (x86)\PHP\v5.3\ext in php.ini, where php is installed.
  4. PHP manager is installed and all the setting and extensions are showing as correct

Even after all these i am not able to hit that ashx file via php. Please let me know if i missed any configuration?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥20 ML307A在使用AT命令连接EMQX平台的MQTT时被拒绝
    • ¥20 腾讯企业邮箱邮件可以恢复么
    • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?
    • ¥15 错误 LNK2001 无法解析的外部符号
    • ¥50 安装pyaudiokits失败
    • ¥15 计组这些题应该咋做呀
    • ¥60 更换迈创SOL6M4AE卡的时候,驱动要重新装才能使用,怎么解决?
    • ¥15 让node服务器有自动加载文件的功能
    • ¥15 jmeter脚本回放有的是对的有的是错的
    • ¥15 r语言蛋白组学相关问题