微信开发$GLOBALS["HTTP_RAW_POST_DATA"]接受不到内容

浏览:580 发布日期:2017/03/18 分类:求助交流
开发微信公众平台中系统是linux的centos7.2。$postStr = $GLOBALS["HTTP_RAW_POST_DATA"];总是为空值,说是php.ini中禁用了register_globals=off改成On就好了,我在我的php.ini中没找到这项。另一种说法是用$postStr = file_get_contents("php://input");替换也可以,但是我也替换了依然接受不到值,折磨一下午了...哭了都~
//响应消息
public function responseMsg()
{
$postStr = $GLOBALS["HTTP_RAW_POST_DATA"];
$postStr = file_get_contents("php://input");
if (!empty($postStr)){

$postObj = simplexml_load_string($postStr, 'SimplexmlElement', LIBxml_NOCDATA);
$RX_TYPE = trim($postObj->MsgType);
echo $postStr;
switch ($RX_TYPE)
最佳答案
评论( 相关
后面还有条评论,点击查看>>