Ubuntu16.04搭建LNMP

1.進(jìn)行更新   (具體文檔請(qǐng)聯(lián)系本博主,首頁(yè)有博主郵箱)

成都創(chuàng)新互聯(lián)自2013年起,是專業(yè)互聯(lián)網(wǎng)技術(shù)服務(wù)公司,擁有項(xiàng)目成都網(wǎng)站建設(shè)、成都網(wǎng)站制作網(wǎng)站策劃,項(xiàng)目實(shí)施與項(xiàng)目整合能力。我們以讓每一個(gè)夢(mèng)想脫穎而出為使命,1280元南平做網(wǎng)站,已為上家服務(wù),為南平各地企業(yè)和個(gè)人服務(wù),聯(lián)系電話:13518219792

2.安裝MySQL

                    # 連續(xù)輸入兩次相同的密碼

3.安裝nginx和php

添加nginx和php的ppa源


4.安裝Nginx

5.安裝PHPFastCGI管理器

6.修改配置文件(此步可以省略)

7.查看 listen = /run/php/php7.0-fpm.sock 是否被開啟

一般為開啟

8.修改重啟下 php-fpm7.0 (可以忽略)

9.修改nginx配置文件

sudo vim /etc/nginx/sites-enabled/default

        # Add index.php to the list if you are using PHP

        index index.php index.html index.htm index.nginx-debian.html;               添加index.php

        server_name _;

        location / {

                # First attempt to serve request as file, then

                # as directory, then fall back to displaying a 404.

                try_files $uri $uri/ =404;

        }

        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000

        #

         location ~ \.php$ {                                                       在此把#去掉

                include snippets/fastcgi-php.conf;                                 在此把#去掉

        #

        #       # With php7.0-cgi alone:

        #       fastcgi_pass 127.0.0.1:9000;                                

        #       # With php7.0-fpm:

               fastcgi_pass unix:/run/php/php7.0-fpm.sock;                          在此把#去掉

         }                                                                          在此把#去掉

 

10.socket 方式 必須和上面socket的listen路徑一樣

11.重啟nginx

12.在/var/www/html/目錄下,新建個(gè)index.php測(cè)試下看看


13.搭建完成 探針顯示

PHP Version 7.0.18-0ubuntu0.16.04.1 

網(wǎng)站名稱:Ubuntu16.04搭建LNMP
本文地址:http://muchs.cn/article6/iehsog.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供Google、網(wǎng)站制作、網(wǎng)站排名、自適應(yīng)網(wǎng)站、網(wǎng)站營(yíng)銷、網(wǎng)站建設(shè)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

小程序開發(fā)