打开网站的 .conf 文件 server

  #error_page 404 /404.html;
  #error_page 502 /502.html;

  # 添加下面一段
  location ~ [^/]\.php(/?.*)$ {
    fastcgi_split_path_info ^(.+?\.php)(/.+)$;
    fastcgi_pass unix:/dev/shm/php-cgi.sock;
    fastcgi_index index.php;
    include fastcgi.conf;
  }
  location ~ [^/]\.php(/|$) {
    #fastcgi_pass remote_php_ip:9000;
    fastcgi_pass unix:/dev/shm/php-cgi.sock;
    fastcgi_index index.php;
    include fastcgi.conf;
  }
  location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|mp4|ico)$ {
    expires 30d;
    access_log off;
  }