8. Install and Configure PHP-FPM

As per the question, I want to understand what went wrong. I can’t find where to request a review for this task. I’ve already tried 8–10 times, and most of the time I get the same error, even though my output (shown in the attachment) looks correct.

Can anyone please help me figure out the issue?

================================

/etc/nginx/nginx.conf

================================

user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;

events {
worker_connections 1024;
}

http {
include /etc/nginx/mime.types;
default_type application/octet-stream;

log_format main '$remote_addr - $remote_user [$time_local] "$request" '
                '$status $body_bytes_sent "$http_referer" '
                '"$http_user_agent" "$http_x_forwarded_for"';
access_log  /var/log/nginx/access.log  main;

sendfile        on;
tcp_nopush      on;
tcp_nodelay     on;
keepalive_timeout 65;

# ------------------------------
# Main server block
# ------------------------------
server {
    listen       8097;
    listen       [::]:8097;
    server_name  stapp01 stapp01.stratos.xfusioncorp.com;
    root         /var/www/html;
    index        index.php index.html;

    # Serve static files directly
    location / {
        try_files $uri $uri/ /index.php?$args;
    }

    # Process PHP files via php-fpm
    location ~ \.php$ {
        include        fastcgi_params;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
    }

    # Security: block hidden files
    location ~ /\.ht {
        deny all;
    }

    error_page 404 /404.html;
    location = /404.html { internal; }

    error_page 500 502 503 504 /50x.html;
    location = /50x.html { internal; }
}

}

Please see if this solution helps you along a bit.

Great, thanks. But I already solved it by updating PHP FPM version, and its listener and group