Deprecated: Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a fut
来源:互联网 发布:淘宝特价清仓花架 编辑:程序博客网 时间:2024/06/08 07:39
“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”
在一次写代码的过程中,因为PHP版本不同,5.6情况下。遇见了一个这样的错误后面找了很多种解决办法,下面我将用两种办法 解决这个问题。
解决办法
1、修改配置文件php.ini
always_populate_raw_post_data = -1
重启php服务就OK了
2、修改代码
把 $postStr = $GLOBALS['HTTP_RAW_POST_DATA']换成 $postStr = isset($GLOBALS['HTTP_RAW_POST_DATA']) ? $GLOBALS['HTTP_RAW_POST_DATA'] : file_get_contents("php://input"); 原理,在php5.6后面的版本 是用php://input来获取原生post参数 (详情参见官网 http://php.net/manual/zh/reserved.variables.httprawpostdata.php)
0 0
- Deprecated: Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a fut
- Deprecated: Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a futu
- Deprecated: Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a futu
- Deprecated</b>: Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a
- Automatically populating $HTTP_RAW_POST_DATA is deprecated......
- Command line warning D9035 : option 'clr:oldsyntax' has been deprecated and will be removed in a fut
- [Warning] '--default-character-set' is deprecated and will be removed in a future release
- Deprecated: mysql_connect(): The mysqlextension is deprecated and will be removed in the future: use
- 解决Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future:
- Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: u
- 解决Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future:
- 解决Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future:
- 解决Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future:
- 解决Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future:
- 解决Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future:
- 解决Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future:
- 解决Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future:
- 解决Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future:
- 针对CPU的nginx配置优化
- React Native 自定义ProgressBar(双平台)
- 2017最新Java基础面试笔试知识整理--java基础篇
- 最短路径—Dijkstra算法和Floyd算法
- 第七周:21. Merge Two Sorted Lists
- Deprecated: Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a fut
- spring中scope作用域(转)
- UnityEngine.Quaternion.LookRotation详解
- 文章分类标签数据库设计
- dispatch_barrier_async和dispatch_barrier_sync的使用
- Python基础——类
- JavaScript for Kids 学习笔记2. 数据类型与变量
- SpringMVC 转发和重定向
- 一个节点rac+单节点dg网络配置(listener.ora与tnsnames.ora)