我是ubuntu,nginx的新用户,我在ubuntu 14.0.4上安装了lnmp。这是我的nginx配置:
server {
[others...]
index index.php index.html index.htm;
[others...]
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
#
# # 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;
}
[others...]
}
我设置'cgi.fix_pathinfo = 0;'在我的php.ini.I中创建了一个名为index.php的/usr/share/nginx/html/
下的php文件,内容为:
<?php
echo phpinfo();
?>
但broswer下载它。我该怎么办?