dsztc99732 2016-09-14 10:02
浏览 1508

在php.ini中将'always_populate_raw_post_data'设置为-1后,$ HTTP_RAW_POST_DATA警告仍显示在POST响应中

So i am using PHP 5.6 and building a Laravel 5.1 API and also building an android app.

When i try sending a post request from the android emulator i get the following message along with the proper data/response:

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
Warning: Cannot modify header information - headers already sent in Unknown on line 0.

I know why the error is showing up, but i cant seem to fix it.

The normal fix would be to set always_populate_raw_post_data to -1 but that is not working.

I am thinking of upgrading to a later version of php where $HTTP_RAW_POST_DATA has been removed.

any help/advice would be appreciated.

  • 写回答

2条回答 默认 最新

  • dougan1465 2016-09-16 14:10
    关注

    Upgrading to php 7.0 fixed it at as expected, i really wanted to avoid upgrading, but it seems that is the only fix in my case as just setting 'always_populate_raw_post_data' to '-1' in php 5.6 did not work for me.

    评论

报告相同问题?

悬赏问题

  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 unity第一人称射击小游戏,有demo,在原脚本的基础上进行修改以达到要求
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)