0
我在這個site 的幫助下安裝nginx,當我升到http://localhost/index.php
時,它給了我空白的屏幕。這是我的默認設置:nginx不執行php文件
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
index index.html index.htm index.php index.nginx-debian.html;
server_name localhost;
location/{
try_files $uri $uri/ /index.html;
}
location /doc/ {
alias /usr/share/doc/;
autoindex on;
allow 127.0.0.1;
allow ::1;
deny all;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# include snippets/fastcgi-php.conf;
#
# # With php5-cgi alone:
fastcgi_pass 127.0.0.1:9000;
# # With php5-fpm:
# fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}
它有什麼問題?
你創建的Nginx和PHP-FPM(如果你得到一個壞網關是一個php-fpm的錯誤(重裝吧))你的根(/ var/www/html)一個index.php文件? – Naramsim
是的, index.php有 – Torondor