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服务

  • 相关阅读:
    scrapy框架持久化存储 以及响应参数
    scrapy框架
    12306 模拟登陆
    Python第三库---requests库详解
    批处理-----4.for循环中的变量
    批处理-----3. for循环详解
    批处理-----2.常用特殊符号
    批处理-----1.内部命令简介
    Python第三方库---requests库
    Python 自带标准库
  • 原文地址:https://www.cnblogs.com/jiafeimao-dabai/p/7477450.html
Copyright © 2011-2022 走看看