Shlomo
Shlomo

Reputation: 3990

Error $HTTP_RAW_POST_DATA is deprecated, use the php://input stream instead."

Using PHP 5.6.2 on MAMP. I upgraded Laravel from 4.1 to 4.2, after fixing some errors and changes as described in Laravel's upgrade docs, I finally get this error:

"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."

Why is that? Where should I change any code? I am not using $HTTP_RAW_POST_DATA anywhere in my code.

I also changed my php.ini as stated, same error... How can I solve this?

Upvotes: 7

Views: 8966

Answers (3)

Vítor Oliveira
Vítor Oliveira

Reputation: 2091

Go to your PHP.ini and search to "always_populate_raw_post_data" and set the value to -1, like:

; Always populate the $HTTP_RAW_POST_DATA variable. PHP's default behavior is
; to disable this feature and it will be removed in a future version.
; If post reading is disabled through enable_post_data_reading,
; $HTTP_RAW_POST_DATA is *NOT* populated.
; http://php.net/always-populate-raw-post-data
always_populate_raw_post_data = -1

Upvotes: 0

Kaushik solanki
Kaushik solanki

Reputation: 438

Please use :

Content-Type = application/x-www-form-urlencoded 

To solve this issue.

Upvotes: 2

Shlomo
Shlomo

Reputation: 3990

The solution to this problem was editing the right php.ini. Then everything worked.

Upvotes: 4

Related Questions