PHP query string limit

I have PHP 5.1.6 (cli) installed, and whenever a GET request string contains more than 128 characters, it fails with an HTTP 406 Not Acceptable error. Any suggestions on how I can fix this can use more than 128 characters? POST is not an option.

The error is returned by the server, so do not think that this is a problem with the browser. And the reason I think this is PHP, not Apache, is that it works great with an HTML file.

GET /test.php?phptestof129characterstring-NEW-WOVEN-FENCE-PANELS-GARDEN_W0QQitemZ200303392512QQihZ010QQcategoryZ139954QQtcZphotoQQcmdZViewItem
HTTP / 1.1
Host: *****
User-Agent: Mozilla / 5.0 (Windows; U; Windows NT 5.1; en-GB; rv: 1.9.0.5) Gecko / 2008120122 Firefox / 3.0.5
Accept: text / html, application / xhtml + xml, application / xml; q = 0.9, * / *; q = 0.8
Accept-Language: en-gb, en; q = 0.5
Accept-Encoding: gzip, deflate
Accept-Charset: ISO-8859-1, utf-8; q = 0.7, *; q = 0.7
Keep-Alive: 300
Connection: keep-alive
Cookie: agent_name = Tim

HTTP / 1.1 406 Not Acceptable
Date: Tue, 03 Feb 2009 12:05:33 GMT
Server: Apache / 2.2.3 (Red Hat)
X-Powered-By: PHP / 5.1.6
Content-Length: 0
Connection: close
Content-Type: text / html

GET /test.html?phptestof129characterstring-NEW-WOVEN-FENCE-PANELS-GARDEN_W0QQitemZ200303392512QQihZ010QQcategoryZ139954QQtcZphotoQQcmdZViewItem
HTTP / 1.1
Host: *****
User-Agent: Mozilla / 5.0 (Windows; U; Windows NT 5.1; en-GB; rv: 1.9.0.5) Gecko / 2008120122 Firefox / 3.0.5
Accept: text / html, application / xhtml + xml, application / xml; q = 0.9, * / *; q = 0.8
Accept-Language: en-gb, en; q = 0.5
Accept-Encoding: gzip, deflate
Accept-Charset: ISO-8859-1, utf-8; q = 0.7, *; q = 0.7
Keep-Alive: 300
Connection: keep-alive
Cookie: agent_name = Tim

HTTP / 1.1 200 OK
Date: Tue, 03 Feb 2009 12:18:19 GMT
Server: Apache / 2.2.3 (Red Hat)
Last-Modified: Fri, 19 Dec 2008 15:01:17 GMT
ETag: "156960d-221-94be8940"
Accept-Ranges: bytes
Content-Length: 545
Connection: close
Content-Type: text/html
+3
4

.

406: test.php? 129 +

: test.php? = 129 +

, , PHP 129 $_GET, 4 , , 128 .

0

mod_security -? -, . , <VirtualHost> .htaccess v1.x

<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>

2.x :

<IfModule mod_security2.c>
    SecRuleEngine Off
</IfModule>

- , documentation, , URI . .

+2

, Javascript, cookie. GET 2 ( ).

, , , , .

0

, :

header('Content-Type: text/html');

. , Apache, , , PHP /html MIME. , Apache, .html PHP script .html?

BTW, http://www.checkupdown.com/status/E406.html:

(, - CheckUpDown) - , -. "accept headers" :

  • : MIME, . , ( HTML, GIF ..), , .
  • Accept-Charset: , .
  • Accept-Encoding: data encoding accepted by the client, for example. file formats are understood.
  • Accept-Language: natural languages ​​(English, German, etc.) accepted by the client.
  • Accept-Ranges: whether the client accepts byte ranges from the resource, i.e. part of the resource.

If the web server detects that the data it wants to return does not fit the client, it returns a header containing 406 error code.

0
source

Source: https://habr.com/ru/post/1702637/


All Articles