LNMP之 php解析

來源:互聯網
上載者:User

標籤:php 解析測試


[[email protected] ~]# 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)

650) this.width=650;" src="http://s5.51cto.com/wyfs02/M01/89/B1/wKioL1gZ9a3RRhrHAAEOggX7_aM570.jpg" title="ng1.jpg" alt="wKioL1gZ9a3RRhrHAAEOggX7_aM570.jpg" />

[[email protected] ~]# iptables -F

[[email protected] ~]# cd /usr/local/nginx/html/  # 在此目錄下寫一個 info.php的指令碼

[[email protected] html]# ls

50x.html  index.html

[[email protected] html]# vim info.php  # 編譯一個 info.php 指令碼

<?php

phpinfo();

?>


通過IP 可以訪問到以下內容

650) this.width=650;" src="http://s4.51cto.com/wyfs02/M01/89/B3/wKiom1gZ91KgxvslAAJVePfEOkM864.jpg" title="ng2.jpg" alt="wKiom1gZ91KgxvslAAJVePfEOkM864.jpg" />


至此PHP 解析測試成功。

本文出自 “CBO#Boy_Linux之路” 部落格,請務必保留此出處http://20151213start.blog.51cto.com/9472657/1868730

LNMP之 php解析

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.