mkdir /web cd /web mkdir htdocs
编辑/root/nginx-1.2.7/conf/nginx.conf,而非/usr/local/nginx/conf/nginx.conf,在文本中server段修改配置:
... location / { root /web/htdocs; index index.php index.html index.htm; } ... location ~ \.php$ { root /web/htdocs; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /web/htdocs/$fastcgi_script_name; include fastcgi_params; }
测试
vim /web/htdocs/index.php <?php phpinfo(); ?>
接下一篇...