location ~ \.php$ { #try_files $uri $uri/index.php; #this param is used to php pass arg fastcgi_split_path_info ^(.+\.php)(/.+)$; #with php-cgi alone #fastcgi_pass 127.0.0.1:9000; #with php5-fpm: fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; }
nginx.conf中有配置fastcgi_pass 这个要和php-fpm.conf中 【www】下的listen = /tmp/fcgi.sock相对应 也可以都改成127.0.0.1:9000