关于laravel发送ajax请求带headers头时(防止csrf),报错Warning: Cannot modify header information

来源:互联网 发布:手机淘宝旺信登录失败 编辑:程序博客网 时间:2024/06/08 02:05
这与PHP版本有关,在warning上面还会报

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已经废弃了$HTTP_RAW_POST_DATA

解决方法:

修改php.ini

always_populate_raw_post_data = -1


阅读全文
0 0
原创粉丝点击