欢迎光临
我们一直在努力

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测试页

赞(0)
【声明】:本博客不参与任何交易,也非中介,仅记录个人感兴趣的主机测评结果和优惠活动,内容均不作直接、间接、法定、约定的保证。访问本博客请务必遵守有关互联网的相关法律、规定与规则。一旦您访问本博客,即表示您已经知晓并接受了此声明通告。