配置好Nginx php后,访问php,出现 403 forbidden错误,原因在于nginx默认不执行index.php,其默认配置在nginx.conf文件中:
location / {
root html;
index index.html index.htm ;
}
修改成:
location / {
root html;
index index.html index.htm index.php;
}
使用 nginx -s reload 重新加载配置,问题解决。