How to remove obsolete Warning message for $HTTP_RAW_POST_DATA?

Asked

Viewed 149 times

2

We are using php://input in the requests in Angularjs:

//método
public function putData() {
     $params = file_get_contents("php://input");
     return json_decode($params);
}

How it’s being used:

$postData = $this->putData();
$request = $this->getRequest();
$request->setParam('data',$postData->token);

I’ve tried to:

$GLOBALS['HTTP_RAW_POST_DATA'] = -1;

Also on htaccess:

<IfModule mod_php5.c>
    php_flag always_populate_raw_post_data -1
</IfModule>

And in php.ini:

always_populate_raw_post_data = -1

And none of it worked. I’m using the Zendframework 1.12.20

To see the errors, we are using php-console, which accuses several such warnings.

  • 1

    There is no possibility to replace it with php://input? Since it is recommended.

  • So, he already does this, the problem is that in php 5.6 he keeps giving this Warning.

  • In the php.ini configure the line always_populate_raw_post_data = -1

  • 1

    @Marcelodeandrade, I’ve done this, including put in the description of the question.

  • You restarted your server after making the change in php.ini nominee?

  • Yes, I restarted, it happened on two different machines, mac and windows.

Show 1 more comment
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.