zoukankan      html  css  js  c++  java
  • Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set 'always_populate_raw_post_data' to '-1' in php.ini and use the php://input

    微信接收推送事件消息时出现 且php版本5.6.31 iis7的服务器

    原先代码接收微信推送消息用 $GLOBALS['HTTP_RAW_POST_DATA']

    结果后台php日志报错 

    Deprecated: Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set 'always_populate_raw_post_data' to '-1' in php.ini and use the php://input stream instead. in Unknown on line 0

    Deprecated 中文释义:过时的
    显然你的 php 版本比较高
    在高版本 php 的发版说明中都有 $HTTP_RAW_POST_DATA 即将(已经)取消,请改用从 php://input 中读取 的声明

    设原来是 $s = $HTTP_RAW_POST_DATA;
    应写作 $s = file_get_contents('php://input');

    $HTTP_RAW_POST_DATA 这个被废弃了,在将来的php版本中还会移除。
    让你用 php://input 代替

    其它备注:顺便看看 php.in配置文件always_populate_raw_post_data前面的分号是不是没去掉 always_populate_raw_post_data = -1

    记得重启PHP服务

  • 相关阅读:
    常春藤之路,从幼儿园开始走起
    常青藤零距离
    web-service
    WebService到底是什么?
    How to add libraries to “External Libraries” in WebStorm/PhpStorm/Intellij
    浏览器核心说明
    万维网
    js和jquery获取span里面的值
    TPshop学习
    sphinx文档
  • 原文地址:https://www.cnblogs.com/jiafeimao-dabai/p/7477450.html
Copyright © 2011-2022 走看看