PHP與nginx整合

編輯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測試頁

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章