我正在使用 Paypal IPN 系统和使用ipnlistener.php的侦听器脚本。从一天开始,Paypal 就没有向我的脚本发送任何帖子数据。代码本身不会有问题,因为 $_POST 变量是空的。因此,如果没有 &_POST 变量,我将无法处理任何事情。(用沙盒试了试)
ipnlistener 类抛出异常:
带有消息“未找到 POST 数据”的异常“异常”。
有人有同样的麻烦吗?
提前致谢..
更新 1
我还扫描了我的日志文件,发现查看日志没有任何意义。每隔一段时间就会出现这个异常:
带有消息“无效响应状态:302”的异常“异常”
但是没有重定向...
我必须修改我的 curl 选项吗?
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_CAINFO, dirname(__FILE__)."/api_cert_chain.crt");
curl_setopt($ch, CURLOPT_URL, $uri); //$uri = https://www.paypal.com/cgi-bin/webscr
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $encoded_data); // For paypal response encoded POST variables
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/x-www-form-urlencoded", "Content-Length: " . strlen($req)));
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, $this->follow_location); // false
curl_setopt($ch, CURLOPT_TIMEOUT, $this->timeout); // 30
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_SSLVERSION, 3);
如果我使用 fsockopen 而不是 curl 也没关系
更新 2
所以今天我从托管的网络空间切换到我自己的虚拟机。我从网络服务器复制了所有内容并再次尝试。哦,看,它有效。我不完全知道为什么,但它与 apache2 配置有关。我检查了托管网络空间上的每个可用日志,但找不到任何相关内容。我也不知道 apache 是如何在 webspace 上编译的。我认为存在版本和/或模块复杂性。php版本是一样的...
如果有人找到解决方案/原因,请告诉我:)
到目前为止......谢谢大家......