php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #72319 FPM status page shows wrong request_uri
Submitted: 2016-06-02 20:00 UTC Modified: -
Votes:17
Avg. Score:4.7 ± 0.7
Reproduced:17 of 17 (100.0%)
Same Version:7 (41.2%)
Same OS:6 (35.3%)
From: zzromanzz at gmail dot com Assigned:
Status: Open Package: FPM related
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2016-06-02 20:00 UTC] zzromanzz at gmail dot com
Description:
------------
PHP FPM status page (FPM config: pm.status_path = /status) in full mode (/status&full) shows 'request uri' from SCRIPT_NAME CGI variable.

This column should report proper value e.g. from REQUEST_URI CGI variable.

There is no way I can determine real uri 'request uri' value when all requests are handled by index.php file and SCRIPT_NAME variable is set to value 'index.php' (I believe this is correct approach)


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-12-05 07:12 UTC] zzromanzz at gmail dot com
Ping :)
 [2021-04-13 21:15 UTC] a dot rzadkowolski at gmail dot com
Also got into this issue today. Also happens with slow log.

This is due how fpm_main.c replaces request_uri with SCRIPT_NAME.

Any idea how nginx/fpm users can work around it?

It happens with basically such setup (notice internal part).

    location / {
        try_files $uri /index.php$is_args$args;
    }

    location ~ ^/index\.php(/|$) {		
        fastcgi_pass php74;
        fastcgi_split_path_info ^(.+\.php)(/.*)$;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
        fastcgi_param DOCUMENT_ROOT $realpath_root;
        internal;
    }

And if you look at status page you will notice that example.com https://example.com/login
renders as:
request URI:          /index.php

Even though in php I can see proper REQUEST_URI variable inside $_SERVER vars.
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Tue Aug 03 10:01:24 2021 UTC