編輯nginx配置文件並保存
vim /usr/local/nginx/conf/nginx.conf
location / {
root html;
index index.php index.html index.htm;
}
location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
編輯PHP主頁test文件並保存
vim ./<htdocs>/index.php
<?php
echo phpinfo();
?>
在你的瀏覽器中輸入 URL: http://<server_ip_or_name>在頁面中查看php測試頁