Learn about Centmin Mod LEMP Stack today
Become a Member

PHP-FPM Unable to get phpstatus working

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by Misters89, Feb 7, 2025.

  1. Misters89

    Misters89 New Member

    8
    0
    1
    Dec 26, 2014
    Ratings:
    +0
    Local Time:
    7:15 AM
    • CentOS Version: AlmaLinux 9.5
    • Centmin Mod Version Installed:
      Code (Text):
      140.00beta01.b198

    • Nginx Version Installed:
      Code (Text):
      nginx version: nginx/1.27.0 (060724-145516-almalinux9-kvm-7010e8c)
    • PHP Version Installed:
      Code (Text):
      PHP 8.1.29 (cli) (built: Jul  6 2024 15:01:40) (NTS)
    • MariaDB MySQL Version Installed: i.e. 10.3.xx or 10.4.xx or 10.6.xx. Run command and post output in CODE/CODEB BBCODE tags:
      Code (Text):
      mysqladmin  Ver 10.0 Distrib 10.6.21-MariaDB, for Linux on x86_64
    • When was last time updated Centmin Mod code base ? : 06/02/2025
    • Persistent Config: Do you have any persistent config file options set in /etc/centminmod/custom_config.inc ? You can check via this command:
      Code (Text):
      SET_DEFAULT_MYSQLCHARSET='utf8mb4'
      SELFSIGNEDSSL_ECDSA='y'
      PHPFINFO='y'
      PHP_OVERWRITECONF='n'
      PYTHON_INSTALL_ALTERNATIVES='y'
      LETSENCRYPT_DETECT='y'
    I can't seem to get it active on the php status page, I think I applied everything correctly as described below.

    ---> PHP-FPM - CentminMod.com LEMP Nginx web stack for CentOS, AlmaLinux, Rocky Linux

    What else can I check?

    Thank you in advance

    Code (Text):
    cat /usr/local/nginx/conf/phpstatus.conf
                location ~ ^/(phpstatus|phpping)$ {
                    access_log          off;
                    fastcgi_pass        127.0.0.1:9000;
                    fastcgi_param     SCRIPT_FILENAME $fastcgi_script_name;
                    include          fastcgi_params;
                    allow              127.0.0.1;
                    deny                all;
                }
                location ~ ^/(phpstatus-pool1-uds|phpping-pool1-uds)$ {
                    access_log          off;
                    fastcgi_pass        unix:/run/php-fpm/php-fpm-pool1-uds.sock;
                    fastcgi_param       SCRIPT_FILENAME $fastcgi_script_name;
                    include             fastcgi_params;
                    allow               127.0.0.1;
                    deny                all;
                }
                location ~ ^/(phpstatus-pool2-uds|phpping-pool2-uds)$ {
                    access_log          off;
                    fastcgi_pass        unix:/run/php-fpm/php-fpm-pool2-uds.sock;
                    fastcgi_param       SCRIPT_FILENAME $fastcgi_script_name;
                    include             fastcgi_params;
                    allow               127.0.0.1;
                    deny                all;
                }
                location ~ ^/(phpstatus-pool3-uds|phpping-pool3-uds)$ {
                    access_log          off;
                    fastcgi_pass        unix:/run/php-fpm/php-fpm-pool3-uds.sock;
                    fastcgi_param       SCRIPT_FILENAME $fastcgi_script_name;
                    include             fastcgi_params;
                    allow               127.0.0.1;
                    deny                all;


    Code (Text):
    [13:29][root@***cut*** includes]# grep "pm.status_path" /usr/local/nginx/conf/phpfpmd/*.conf
    /usr/local/nginx/conf/phpfpmd/phpfpm_pool1_uds.conf:pm.status_path = /phpstatus-pool1-uds
    /usr/local/nginx/conf/phpfpmd/phpfpm_pool2.conf:pm.status_path = /phpstatus-pool2
    /usr/local/nginx/conf/phpfpmd/phpfpm_pool2_uds.conf:pm.status_path = /phpstatus-pool2-uds
    /usr/local/nginx/conf/phpfpmd/phpfpm_pool3.conf:pm.status_path = /phpstatus-pool3
    /usr/local/nginx/conf/phpfpmd/phpfpm_pool3_uds.conf:pm.status_path = /phpstatus-pool3-uds
    /usr/local/nginx/conf/phpfpmd/phpfpm_pool4.conf:pm.status_path = /phpstatus-pool4
    /usr/local/nginx/conf/phpfpmd/phpfpm_pool5.conf:pm.status_path = /phpstatus-pool5


    Code (Text):
    [13:30][root@***cut*** includes]# cat /usr/local/nginx/conf/conf.d/virtual.conf
    server {
        listen 127.0.0.1:8080; # Alleen toegankelijk vanaf localhost
        server_name localhost;
    
        location /nginx_status {
            stub_status;
            allow 127.0.0.1; # Alleen lokale toegang toestaan
            deny all;
        }
    }
    
    server {
                listen 80 default_server backlog=131070 reuseport;
                server_name *****cut******;
                root   html;
    
            access_log              /var/log/nginx/localhost.access.log     combined buffer=256k flush=5m;
            #access_log              /var/log/nginx/localhost.access.json    main_json buffer=256k flush=5m;
            error_log               /var/log/nginx/localhost.error.log      error;
    
    # ngx_pagespeed & ngx_pagespeed handler
    #include /usr/local/nginx/conf/pagespeed.conf;
    #include /usr/local/nginx/conf/pagespeedhandler.conf;
    #include /usr/local/nginx/conf/pagespeedstatslog.conf;
    
    # limit_conn limit_per_ip 16;
    # ssi  on;
    
    location /deploy/ {
        auth_basic "Private";
        auth_basic_user_file /usr/local/nginx/conf/htpasswd_admin_php;
        include /usr/local/nginx/conf/php.conf;
    }
    
                location / {
    
    # block common exploits, sql injections etc
    #include /usr/local/nginx/conf/block.conf;
    
    #Enables directory listings when index file not found
    #autoindex  on;
    
    #Shows file listing times as local time
    #autoindex_localtime on;
    
    # Wordpress Permalinks example
    #try_files \$uri \$uri/ /index.php?q=\$uri&\$args;
    
                }
    
    include /usr/local/nginx/conf/php.conf;
    include /usr/local/nginx/conf/phpmyadmin.conf;
    include /usr/local/nginx/conf/staticfiles.conf;
    include /usr/local/nginx/conf/include_opcache.conf;
    
    include /usr/local/nginx/conf/phpstatus.conf;
    include /usr/local/nginx/conf/drop.conf;
    #include /usr/local/nginx/conf/errorpage.conf;
    #include /usr/local/nginx/conf/vts_mainserver.conf;
    
           }


    Code (Text):
    [13:31][root@***cut*** includes]# grep "pm.status_path" /usr/local/etc/php-fpm.conf
    pm.status_path = /phpstatus


    Code (Text):
    [13:38][root@***cut*** includes]# curl -I http://127.0.0.1/phpstatus
    HTTP/1.1 404 Not Found
    Date: Fri, 07 Feb 2025 12:38:48 GMT
    Content-Type: text/html; charset=utf-8
    Content-Length: 146
    Connection: keep-alive
    Server: nginx centminmod
    X-Powered-By: centminmod
    
    [13:38][root@***cut*** includes]# curl -I http://127.0.0.1:9000/phpstatus
    curl: (56) Recv failure: Connection reset by peer


     
  2. eva2000

    eva2000 Administrator Staff Member

    58,893
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    3:15 PM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    Seems you have modified main hostname's nginx vhost at /usr/local/nginx/conf/conf.d/virtual.conf from defaults. Though the changes shouldn't image /phpstatus output

    Just tested this on one of my servers running AlmaLinux 8
    Code (Text):
    curl -I http://127.0.0.1/phpstatus
    HTTP/1.1 200 OK
    Date: Fri, 07 Feb 2025 20:26:18 GMT
    Content-Type: text/html; charset=UTF-8
    Connection: keep-alive
    Vary: Accept-Encoding
    Expires: Thu, 01 Jan 1970 00:00:00 GMT
    Cache-Control: no-cache, no-store, must-revalidate, max-age=0
    Server: nginx centminmod
    X-Powered-By: centminmod
    

    Code (Text):
    curl -s http://127.0.0.1/phpstatus
    pool:                 www
    process manager:      ondemand
    start time:           07/Feb/2025:12:30:55 -0600
    start since:          6934
    accepted conn:        6
    listen queue:         0
    max listen queue:     0
    listen queue len:     524280
    idle processes:       1
    active processes:     1
    total processes:      2
    max active processes: 1
    max children reached: 0
    slow requests:        0
    

    You can edit /usr/local/nginx/conf/phpstatus.conf and enable for each access_log directive change from off to on and restart nginx server and then check the main hostname nginx vhost's access log for clues
    Code (Text):
    tail -10 /var/log/nginx/localhost.access.log
    

    and main hostname's nginx vhost error log
    Code (Text):
    tail -10 /var/log/nginx/localhost.error.log