Home >Backend Development >PHP Tutorial >Why are My GET Request Parameters Missing in PHP's `$_GET` Array?

Why are My GET Request Parameters Missing in PHP's `$_GET` Array?

Linda Hamilton
Linda HamiltonOriginal
2024-12-11 19:23:11979browse

Why are My GET Request Parameters Missing in PHP's `$_GET` Array?

URL Parameter Size Limits in _GET

Problem:

When accessing a PHP server via REST, a parameter passed in a GET request is absent from the _GET global variable. Reducing the length of the parameter allows it to be received.

Solution:

This issue arises due to a maximum size limit imposed on URL parameters in certain PHP configurations. This limitation, which is not explicitly documented, may be related to the suhosin patch.

To resolve this issue and support longer parameters, one can add the following line to the php.ini configuration file:

suhosin.get.max_value_length = <limit>

Where is the desired maximum length for GET parameters. This configuration setting will increase the size limit for parameters in the _GET array.

The above is the detailed content of Why are My GET Request Parameters Missing in PHP's `$_GET` Array?. 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