继续浏览精彩内容
慕课网APP
程序员的梦工厂
打开
继续
感谢您的支持,我会继续努力的
赞赏金额会直接到老师账户
将二维码发送给自己后长按识别
微信支付
支付宝支付

LNMP之 php解析

一只甜甜圈
关注TA
已关注
手记 248
粉丝 56
获赞 118


[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)

https://img.mukewang.com/5b07bdc500012f6708180421.jpg

[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 脚本

<?php

phpinfo();

?>


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

https://img4.mukewang.com/5b07bdd00001234508350457.jpg


至此PHP 解析测试成功。

打开App,阅读手记
0人推荐
发表评论
随时随地看视频慕课网APP