Home >Backend Development >PHP Tutorial >How to Increase the Maximum Length of URL Parameters in PHP's $_GET?

How to Increase the Maximum Length of URL Parameters in PHP's $_GET?

Susan Sarandon
Susan SarandonOriginal
2025-01-02 13:57:411042browse

How to Increase the Maximum Length of URL Parameters in PHP's $_GET?

Max Size of URL Parameters in _GET

Q: In a PHP application accessing data through RESTful GET requests, a URL parameter fails to appear in the _GET array when exceeding a certain length. Is there a method to adjust this maximum length?

A: This issue might arise due to a limitation imposed by Suhosin. Suhosin patched PHP installations impose a default limit of 512 characters for GET parameters. While browsers and Apache support longer URLs, this limitation can cause issues.

Solution:

To extend the maximum length for parameters with Suhosin, add the following line to your php.ini configuration:

suhosin.get.max_value_length = <limit>

Substitute with the desired maximum length.

The above is the detailed content of How to Increase the Maximum Length of URL Parameters in PHP's $_GET?. 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