在nginx配置文件里面写入php的内容,一直报错,您能帮我看一下吗
上面 } } 多了吧,黄色代码块上面几行,连续两行是}
修改主配置文件以支持php
#在server模块增加以下配置,如果有直接整合location,加入相应配置即可。
location ~ .*\.(php|php5)?$
{
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi.conf;
}
location /
{
root html;
index index.html index.htm index.php;
}
测试访问,修改nginx默认首页文件inde.html为index.php,并增加以下内容:
<?php
phpinfo();
?>
测试访问