View Issue Details

IDProjectCategoryView StatusLast Update
0000675AlmaLinux-9nginxpublic2026-09-21 19:28
Reporterappsforge Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status newResolutionopen 
Platformx86_64OSalmalinuxOS Version9.8
Summary0000675: $realpath_root in fastcgi_param triggers fastcgi request length mismatch
DescriptionDistribution: AlmaLinux 9.8

Package:
nginx-1.24.0-7.module_el9.8.0+307+7a7a3a71.5.alma.1.x86_64

PHP is executed through PHP-FPM.

Problem

After updating nginx to the package above, using the nginx variable $realpath_root as the value of a fastcgi_param causes nginx to abort the FastCGI request with:

[alert] ... fastcgi request length mismatch

The problem is reproducible with an otherwise unused FastCGI parameter, so it does not appear to be related to PHP's handling of DOCUMENT_ROOT or SCRIPT_FILENAME.
Steps To ReproduceMinimal reproducer

A FastCGI configuration containing the following parameter triggers the problem:

fastcgi_param TEST_REALPATH $realpath_root;

For example:

location ~ \.php$ {
    include fastcgi_params;

    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_param TEST_REALPATH $realpath_root;

    fastcgi_pass unix:/run/php-fpm/www.sock;
}

Requesting an existing PHP file results in nginx logging:

[alert] ... fastcgi request length mismatch

and the FastCGI request is not processed normally.

Control tests

Replacing $realpath_root with $document_root works:

fastcgi_param TEST_DOCUMENT_ROOT $document_root;

Removing the additional parameter also makes the FastCGI request work.

PHP-FPM itself works correctly when invoked directly using cgi-fcgi.

$realpath_root also works correctly outside FastCGI. For example, using it in an HTTP response header produces the expected resolved filesystem path.

Therefore the problem appears to be specific to the use of $realpath_root during FastCGI parameter construction.
TagsNo tags attached.

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2026-09-21 19:28 appsforge New Issue