HProse for PHP reports an error under PHP5.6: Automatically populating $http_raw_post_data is deprecated and will be removed in a Future version. Solution

以http://www.hprose2.com/http_client.php为客户端,运行结果,报错:Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version.

1. Open: https://github.com/hprose/hprose-php/blob/master/readme_zh_cn.md, download hprose for php;

2. Take http://www.hprose1.com/http_server.php as the server, and the running result is shown in Figure 1:

以http://www.hprose1.com/http_server.php为服务端,运行结果
Take http://www.hprose1.com/http_server.php as the server, the running result

3. Take http://www.hprose2.com/http_client.php as the client, the running result is shown in Figure 2: An error is reported:

以http://www.hprose2.com/http_client.php为客户端,运行结果,报错:Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version.
Take http://www.hprose2.com/http_client.php as the client, run the result, and report an error: automatic popularly popular $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version.

4. Set in the php.ini file: always_populate_raw_post_data = -1, with http://www.hprose2.com/http_client.php as the client, the result of running again is shown in Figure 3:

在php.ini文件中设置:always_populate_raw_post_data = -1
Set in the php.ini file: always_populate_raw_post_data = -1
以http://www.hprose2.com/http_client.php为客户端,再次运行结果:Hello World
Take http://www.hprose2.com/http_client.php as the client, run the result again: hello world

 

Note: https://bugs.php.net/bug.php?id=66763

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.