[php-src] Issue #12982: php-fpm fail to process uris above 32kb in length
| From: | divinity76 | Date: | Wed, 20 Dec 2023 11:02:51 +0000 |
| Subject: | [php-src] Issue #12982: php-fpm fail to process uris above 32kb in length | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-246080@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/12982
Author: divinity76
### Description
Assuming php-fpm and nginx configured to allow large URLs (
http{ large_client_header_buffers
8 999k; ...} )
The following code:
```php
<?php
$url = "http://localhost/?a=" .
str_repeat("a", 33*1024);
$ch = curl_init($url);
curl_exec($ch);
```
Resulted in
```
<html>
<head><title>502 Bad Gateway</title></head>
<body>
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx/1.22.1</center>
</body>
</html>
```
and /var/log/nginx/error.log containing
>2023/12/20 06:15:30 [error] 7980#7980: *32033 writev() failed (32: Broken pipe) while sending
>request to upstream, client: 162.248.164.115, server: localhost, request: "GET
>/?a=aaaaaaaaaa(...)
and nothing in /var/log/php8.2-fpm.log
But I expected... a notice in the php-fpm log that something went wrong? and maybe a HTTP 414
Request-URL too long error instead of a 502 Bad Gateway ?
### PHP Version
PHP 8.2.7
### Operating System
Debian 12