网站首页 博客 nginx配置运行php环境
Nginx运行php是通过fastcgi方式,配置方法如下
location ~ \.php$ {
root /path/to/webroot;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param s.c.r.i.p.t_FILENAME $document_root$fastcgi_s.c.r.i.p.t_name;
include fastcgi_params;
}
然后重启Nginx