首页 > 代码库 > lnmp 通过localhost访问本地80端口并解析PHP

lnmp 通过localhost访问本地80端口并解析PHP

vi /etc/nginx/conf.d/default.conf

# 删除如下部分的注释,

#把一下倒数第二行的/scripts改为你工程目录,如:

# fastcgi_param  SCRIPT_FILENAME  /usr/share/nginx/html$fastcgi_script_name;

location ~ \.php$ {

    root           html;

    fastcgi_pass   127.0.0.1:9000;

    fastcgi_index  index.php;

    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;

    include        fastcgi_params;

}