Linux 下nginx配置php

1. 修改配置文件

配置文件:/etc/nginx/sites-available/default

location ~ \.php$ {
    root /usr/share/nginx/html;
    fastcgi_pass 127.0.0.1:9000;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include fastcgi_params;
}

2. 重启nginx

$ service nginx restart

你可能感兴趣的:(Linux 下nginx配置php)