果果、 发表于 2018-12-15 09:51:30

LNMP之 php解析

  

  # 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_indexindex.php;
              fastcgi_paramSCRIPT_FILENAME/usr/local/nginx/html$fastcgi_script_name;
                                       #(scripts$fastcgi_script_name;)
              include      fastcgi_params;
  

  更改完成以后,保存退出。通过 ip地址可以访问到 nginx的首页。
  如下图:(如果访问不了可以 尝试关掉linux 自带的防火墙 iptables -F)
http://s5.运维网.com/wyfs02/M01/89/B1/wKioL1gZ9a3RRhrHAAEOggX7_aM570.jpg
  # iptables -F
  # cd /usr/local/nginx/html/# 在此目录下写一个 info.php的脚本
  # ls
  50x.htmlindex.html
  # vim info.php# 编译一个 info.php 脚本
  
  

  通过IP 可以访问到以下内容
http://s4.运维网.com/wyfs02/M01/89/B3/wKiom1gZ91KgxvslAAJVePfEOkM864.jpg
  

  至此PHP 解析测试成功。



页: [1]
查看完整版本: LNMP之 php解析