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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM