栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > PHP

LNMP之 php解析

PHP 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

LNMP之 php解析


[root@LNMP ~]# vim /usr/local/nginx/conf/nginx.conf


打开以下PHP 相关项且更改 scripts$fastcgi_script_name;> /usrlocal/nginx/html$fastcgi_script_name;

      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;

                                     #(scripts$fastcgi_script_name;)

            include        fastcgi_params;


更改完成以后,保存退出。通过 ip地址可以访问到 nginx  的首页。

如下图:(如果访问不了可以 尝试关掉linux 自带的防火墙 iptables -F)

[root@LNMP ~]# iptables -F

[root@LNMP ~]# cd /usr/local/nginx/html/  # 在此目录下写一个 info.php的脚本

[root@LNMP html]# ls

50x.html  index.html

[root@LNMP html]# vim info.php  # 编译一个 info.php 脚本

phpinfo();

?>


通过IP 可以访问到以下内容


至此PHP 解析测试成功。

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/229363.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号