session_start(): Cannot send session cache limiter - headers already sent

报错信息:

session_start(): Cannot send session cache limiter - headers already sent

或者

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

原因:

  PHP5.6的$HTTP_RAW_POST_DATA被废弃了,而且在PHP7中把它移除了。因为这个参数影响性能,所以要废弃掉,官方建议用php://input来代替。 

 

修复方式:

  打开php.ini,去掉:always_populate_raw_post_data前面的分号,并且值设置为:-1,就可以了

  没有找到就加一行

  always_populate_raw_post_data = -1

posted @ 2020-04-24 15:59  贱贱丶  阅读(982)  评论(0编辑  收藏  举报