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