LNMP 1.3 测试php解析

测试解析LNMP的php解析

先打开nginx的配置文件

vim /usr/local/nginx/conf/nginx.conf
        location ~ .php$ {
            root           html;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  /usr/local/nginx/html$fastcgi_script_name;
            include        fastcgi_params;
        }

把注释掉的这段打开,并修改路径,上面红色部分

在浏览器输入ip地址,显示nginx欢迎界面

写一个php

 vim /usr/local/nginx/html/info.php
<?php
phpinfo();
?>

重启

/usr/local/nginx/sbin/nginx -s reload

在浏览器输入

192.168.1.117/info.php

解析成功

原文地址:https://www.cnblogs.com/wangshaojun/p/5084293.html