Home  >  Article  >  Backend Development  >  What should I do if an error occurs when php receives post parameters?

What should I do if an error occurs when php receives post parameters?

coldplay.xixi
coldplay.xixiOriginal
2020-10-06 14:30:432487browse

Solution to the error when php receives post parameters: First search for [always_populate_raw_post_data] in [php.ini]; then remove the previous [;] and restart the service.

What should I do if an error occurs when php receives post parameters?

Solution to the error when php receives post parameters:

An error occurs when php receives postman data

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

The reason found online is: the local PHP version is too high, postman sent The incoming data uses $HTTP_RAW_POST_DATA to receive the data and an error occurs. Change the assignment method of $_POST and you can

Search for [always_populate_raw_post_data] in php.ini

Remove the previous [;] and restart the service. It can be received normally, but I am not very clear about this at the moment. Why is there no error when receiving $_POST data in the framework, but an error is reported when a separate script receives data

Related free Learning recommendation: php programming (video)

The above is the detailed content of What should I do if an error occurs when php receives post parameters?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn