Getting this error:
- The URL is displaying ‘index.php’ in plain text, which indicates that either PHP-FPM is not installed, or Nginx is not configured to work with PHP-FPM.
Solution:
ssh steve@stapp02
sudo -i
dnf install -y nginx
dnf module -y install php:8.1/common
vi /etc/php-fpm.d/www.conf
listen = 9000
user = nginx
group = nginx
vi /etc/nginx/nginx.conf
server {
listen 8093 default_server;
listen [::]:8093 default_server;
server_name _;
root /var/www/html;
location ~ \.php$ {
try_files $uri =404;
include fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}
chown nginx:nginx /var/www/html/index.php
systemctl enable php-fpm --now
systemctl enable nginx --now
[steve@stapp02 ~]$ curl http://stapp02:8093/index.php
404 Not Found404 Not Found
nginx/1.20.1
Guide me what went wrong.


