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

  • 相关阅读:
    登录注册功能
    29-----BBS论坛
    linux笔记
    nginx,uwsgi发布web服务器
    linux常用服务部署
    linux系统基础优化及常用命令
    linux基本操作命令
    linux命令
    linux基础
    阿里云服务器搭建
  • 原文地址:https://www.cnblogs.com/jiafeimao-dabai/p/7477450.html
Copyright © 2020-2023  润新知