ผมได้ติดตั้งเซิร์ฟเวอร์ทดสอบโดยใช้+nginx php-fpmฉันได้ลองทำสิ่งต่อไปนี้แล้ว:
Nginx + Php5-fpm ไม่แสดงผลไฟล์ php
nginx + php fpm -> 404 หน้า php - ไม่พบไฟล์
เมื่อเข้าถึงไฟล์ PHP nginx จะแสดงข้อผิดพลาด 404
สรุปสิ่งที่ฉันได้ลอง:
- การติดตั้ง
 - การเปลี่ยนสิทธิ์ของสคริปต์ (เปลี่ยนเป็น
0777) fastcgi_intercept_errors on.- ตรวจสอบ
rootคำสั่งในระดับนี้server, และlocationlocation ~ \.php - ตรวจสอบ
fastcgi_param SCRIPT_FILENAMEคำสั่ง 
เซิร์ฟเวอร์ส่งคืน 404 .phpสคริปต์เปิด (และบนเท่านั้น) ฉันสามารถเปลี่ยนชื่อพวกเขาเป็น.htmlและพวกเขาจะไม่เป็นไร ฉันจะไปเกี่ยวกับเรื่องนี้ได้อย่างไร
นี่คือของฉันnginx.conf:
user nginx;
worker_processes 1;
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;
    keepalive_timeout  2;
    include /etc/nginx/conf.d/*.conf;
    index   index.html index.htm;
    server {
        listen       80;
        server_name  _;
        root         /var/www/html;
        location / {
            root /var/www/html;
            index index.php index.html index.htm;
        }
        error_page  404              /404.html;
        location = /40x.html {
            #root /var/www/html;
        }
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            #root /var/www/html;
        }
        location ~ \.php$ {
            root           /var/www/html;
            try_files $uri =404;
            fastcgi_split_path_info ^(.+\.php)(/.+)$;
            fastcgi_pass   unix:/var/run/php5-fpm.sock;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
            include        fastcgi_params;
        }
    }
}