Deprecated: Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a fut
2017-03-10 12:25
525 查看
“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情况下。遇见了一个这样的错误后面找了很多种解决办法,下面我将用两种办法 解决这个问题。
重启php服务就OK了
2、修改代码
在一次写代码的过程中,因为PHP版本不同,5.6情况下。遇见了一个这样的错误后面找了很多种解决办法,下面我将用两种办法 解决这个问题。
解决办法
1、修改配置文件php.inialways_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)
相关文章推荐
- Deprecated</b>: Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a
- 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
- PHP 5.6 中 Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version
- 报错:Deprecated: Automatically populating $HTTP_RAW_POST_DATA is deprecated
- 解决Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future:
- Command line warning D9035 : option 'clr:oldsyntax' has been deprecated and will be removed in a fut
- 解决Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future:
- [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
- extension is deprecated and will be removed in the
- 解决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:
- 解决MYSQL弃用模块错误Deprecated: mysql_query(): 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:
- 解决PHP中Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the futu
- 解决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: