内射老阿姨1区2区3区4区_久久精品人人做人人爽电影蜜月_久久国产精品亚洲77777_99精品又大又爽又粗少妇毛片

源碼編譯安裝LNMP-創(chuàng)新互聯(lián)

一、nginx概述

      LNMP=Linux Nginx Mysql PHP
Nginx ("engine x") 是一個(gè)高性能的 HTTP 和 反向代理 服務(wù)器。Nginx 是由 Igor Sysoev 為俄羅斯訪問(wèn)量第二的 Rambler.ru 站點(diǎn)開(kāi)發(fā)的,第一個(gè)公開(kāi)版本0.1.0發(fā)布于2004年10月4日。其將源代碼以類(lèi)BSD許可證的形式發(fā)布,因它的穩(wěn)定性、豐富的功能集、示例配置文件和低系統(tǒng)資源的消耗而聞名。2011年6月1日,nginx 1.0.4發(fā)布。

      Nginx是一款輕量級(jí)的Web 服務(wù)器/反向代理服務(wù)器及電子郵件(IMAP/POP3)代理服務(wù)器,并在一個(gè)BSD-like 協(xié)議下發(fā)行。由俄羅斯的程序設(shè)計(jì)師Igor Sysoev所開(kāi)發(fā),供俄國(guó)大型的入口網(wǎng)站及搜索引擎Rambler(俄文:Рамблер)使用。其特點(diǎn)是占有內(nèi)存少,并發(fā)能力強(qiáng),事實(shí)上nginx的并發(fā)能力確實(shí)在同類(lèi)型的網(wǎng)頁(yè)服務(wù)器中表現(xiàn)較好,中國(guó)大陸使用nginx網(wǎng)站用戶有:百度BWS、新浪、網(wǎng)易、騰訊等

Nginx官方網(wǎng)站

      RamBler:http://www.rambler.ru/               Nginx:http://nginx.org/
源碼編譯安裝LNMP

城中ssl適用于網(wǎng)站、小程序/APP、API接口等需要進(jìn)行數(shù)據(jù)傳輸應(yīng)用場(chǎng)景,ssl證書(shū)未來(lái)市場(chǎng)廣闊!成為創(chuàng)新互聯(lián)建站的ssl證書(shū)銷(xiāo)售渠道,可以享受市場(chǎng)價(jià)格4-6折優(yōu)惠!如果有意向歡迎電話聯(lián)系或者加微信:028-86922220(備注:SSL證書(shū)合作)期待與您的合作!

在Nginx中,我們使用的是php-fpm來(lái)對(duì)php頁(yè)面解析,PHP-FPM其實(shí)是PHP源代碼的一個(gè)補(bǔ)丁,指在將FastCGI進(jìn)程管理整合進(jìn)PHP包中。必須將它patch到你的PHP源代碼中,再編譯安裝PHP后才可以使用
      從PHP5.3.3開(kāi)始,PHP中直接整合了PHP-FPM,所以從PHP5.3.3版本以后,不需要下載PHP-FPM補(bǔ)丁包了,下面是PHP-FPM官方發(fā)出來(lái)的通知:
      http://php-fpm.org/download

二、Nginx的工作原理
Nginx 本身只支持靜態(tài)頁(yè)面的處理,當(dāng)客戶端訪問(wèn)php頁(yè)面的時(shí)候,nginx會(huì)將php轉(zhuǎn)到php-fpm也處理,
php-fpm服務(wù)會(huì)把php頁(yè)面解析成html文件給nginx處理,nginx返回給客戶端處理
這里需要結(jié)合Apache的工作,對(duì)PHP文件處理過(guò)程的區(qū)別
      1:Nginx是通過(guò)php-fpm這個(gè)服務(wù)來(lái)處理php文件
      2:Apache是通過(guò)libphp5.so這個(gè)模塊來(lái)處理php文件
Apache:

源碼編譯安裝LNMP

Nginx:
源碼編譯安裝LNMP

      Apache的libphp5.so隨著apache服務(wù)器一起運(yùn)行,而Nginx和php-fpm是各自獨(dú)立運(yùn)行,所以在服務(wù)的運(yùn)行過(guò)程中,Nginx和php-fpm都需要分別啟動(dòng)!
修改Nginx配置文件,啟動(dòng)nginx服務(wù),修改php配置文件,啟動(dòng)php-fpm服務(wù)。

三、安裝環(huán)境

系統(tǒng)環(huán)境:CentOS release 6.9 64bit
軟件名稱:libmcrypt-2.5.8、mysql-5.6.26、nginx-1.9.4、pcre-8.37、php-5.6.13

軟件安裝位置:/usr/local/

數(shù)據(jù)存放位置:/usr/local/nginx/html、/usr/local/mysql/data

日志存放位置:/usr/local/nginx/logs、/usr/local/mysql/logs

四、安裝lnmp

1、編譯安裝nginx

1)安裝開(kāi)發(fā)工具包

yum -y groupinstall "Development Tools" "Development Libraries"

2)安裝依賴包

yum -y install gcc gcc-c++ autoconf automake zlib zlib-devel openssl openssl-devel pcre* pcre-devel

3)在home創(chuàng)建lnmp文件夾,將對(duì)應(yīng)軟件包上傳到這個(gè)文件夾

[root@centos-6 lnmp]# ll
total 50292
-rw-r--r-- 1 root root  875425 Jun 10 07:10 libmcrypt-2.5.8.tar.bz2
-rw-r--r-- 1 root root 33278710 Jun 10 07:10 mysql-5.6.26.tar.gz
-rw-r--r-- 1 root root  832104 Jun 10 07:10 nginx-1.8.0.tar.gz
-rw-r--r-- 1 root root  866423 Jun 10 07:11 nginx-1.9.4.tar.gz
-rw-r--r-- 1 root root 1557603 Jun 10 07:10 pcre-8.37.tar.bz2
-rw-r--r-- 1 root root 14077633 Jun 10 07:10 php-5.6.13.tar.bz2
[root@centos-6 lnmp]#

4)解壓pcre軟件包

解壓此安裝包即可,不需要安裝,Nginx需要指定pcre的源碼不是安裝后的路徑,此包的功能是支持地址重寫(xiě)rewrite功能 pcre的依賴可以yum安裝pcre和pcre-devel解決!

tar jxvf pcre-8.37.tar.bz2 -C /usr/local/src/

5)編譯安裝nginx

[root@centos-6 lnmp]# tar zxvf nginx-1.9.4.tar.gz -C /usr/local/src/
[root@centos-6 lnmp]# cd /usr/local/src/nginx-1.9.4/[root@centos-6 nginx-1.9.4]# ./configure --prefix=/usr/local/nginx --with-http_dav_module
--with-http_stub_status_module --with-http_addition_module
--with-http_sub_module --with-http_flv_module --with-http_mp4_module
--with-pcre=/usr/local/src/pcre-8.37

6)功能模塊說(shuō)明:

--with-http_dav_module                 #啟用支持(增加PUT,DELETE,MKCOL:創(chuàng)建集合,COPY和MOVE方法)
                                   默認(rèn)關(guān)閉,需要編譯開(kāi)啟
--with-http_stub_status_module   #啟用支持(獲取Nginx上次啟動(dòng)以來(lái)的工作狀態(tài))
--with-http_addition_module        #啟用支持(作為一個(gè)輸出過(guò)濾器,支持不完全緩沖,分部分相應(yīng)請(qǐng)求)
--with-http_sub_module                #啟用支持(允許一些其他文本替換Nginx相應(yīng)中的一些文本)
--with-http_flv_module                  #啟用支持(提供支持flv視頻文件支持)
--with-http_mp4_module                     #啟用支持(提供支持mp4視頻文件支持,提供偽流媒體服務(wù)端支持)
--with-pcre=/usr/local/src/pcre-8.37  #需要注意,這里指的是源碼,用#./configure --help |grep pcre查看幫助

7)采用多線程編譯加快速度

[root@centos-6 nginx-1.9.4]# make -j 4 && make install

8)創(chuàng)建沒(méi)家目錄及登錄權(quán)限的nginx運(yùn)行帳號(hào)

[root@centos-6 lnmp]# useradd -M -s /sbin/nologin nginx

9)配置nginx支持php及修改運(yùn)行用戶

[root@centos-6 nginx-1.9.4]#vim /usr/local/nginx/conf/nginx.conf

#user nobody;
user nginx nginx;                  #添加此行

#location ~ \.php$ {
       #   root          html;
       #   fastcgi_pass  127.0.0.1:9000;
       #   fastcgi_index index.php;
       #   fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
       #   include       fastcgi_params;
       #}                     #找到上面這段內(nèi)容,將這段內(nèi)容復(fù)制,去掉#且修改為如下

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修改為nginx的html,即Nginx頁(yè)面目錄,因?yàn)橐幚淼膒hp文件也在這個(gè)目錄下
   include       fastcgi_params;
}

10)啟動(dòng)nginx并查看狀態(tài)是否啟動(dòng)成功

[root@centos-6 nginx-1.9.4]# /usr/local/nginx/sbin/nginx
[root@centos-6 nginx-1.9.4]# ps -aux | grep nginx
Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.8/FAQ
root     7715 0.0 0.0 21756  840 ?       Ss  07:38  0:00 nginx: master process /usr/local/nginx/sbin/nginx
nginx    7716 0.0 0.0 22108 1412 ?       S   07:38  0:00 nginx: worker process
root     7718 0.0 0.0 103328  876 pts/2   S+  07:38  0:00 grep nginx
[root@centos-6 nginx-1.9.4]# netstat -antup | grep nginx
tcp       0     0 0.0.0.0:80                 0.0.0.0:*                  LISTEN     7715/nginx
[root@centos-6 nginx-1.9.4]#

11)nginx維護(hù)命令

[root@centos-6 nginx-1.9.4]# /usr/local/nginx/sbin/nginx -tnginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is oknginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful[root@centos-6 nginx-1.9.4]#
[root@centos-6 nginx-1.9.4]# /usr/local/nginx/sbin/nginx -s reload           //重新加載配置文而建(平滑重啟)平滑重啟(保持了C-S鏈接,不斷開(kāi),服務(wù)器只是重新加載了配置文件,沒(méi)有開(kāi)啟和關(guān)閉的服務(wù)器的一個(gè)動(dòng)作)
[root@centos-6 nginx-1.9.4]# /usr/local/nginx/sbin/nginx -s stop            //停止Nginx,注意:?jiǎn)?dòng)沒(méi)有任何參數(shù)
[root@centos-6 nginx-1.9.4]# echo "/usr/local/nginx/sbin/nginx &" >> /etc/rc.local

12)查看nginx是否安裝成功

源碼編譯安裝LNMP

2、編譯安裝mysql

1)清理已安裝的mysql

[root@centos-6 home]# rpm -qa | grep mysql
mysql-libs-5.1.73-8.el6_8.x86_64
[root@centos-6 home]# yum remove mysql-libs
[root@centos-6 home]# rpm -qa | grep mysql
[root@centos-6 home]#

2)安裝依賴包

[root@centos-6 home]# yum install -y cmake ncurses-devel

3)編譯安裝mysql

[root@centos-6 lnmp]# tar xf mysql-5.6.26.tar.gz -C /usr/local/src/

3)創(chuàng)建運(yùn)行mysql的帳號(hào)

[root@centos-6 mysql-5.6.26]# useradd -M -s /sbin/nologin mysql

4)配置編譯參數(shù)

[root@centos-6 mysql-5.6.26]#cmake \
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DMYSQL_UNIX_ADDR=/tmp/mysql.sock \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DWITH_EXTRA_CHARSETS=all \
-DWITH_MYISAM_STORAGE_ENGINE=1\
-DWITH_INNOBASE_STORAGE_ENGINE=1\
-DWITH_MEMORY_STORAGE_ENGINE=1\
-DWITH_READLINE=1\
-DENABLED_LOCAL_INFILE=1\
-DMYSQL_DATADIR=/usr/local/mysql/data \
-DMYSQL-USER=mysql

5)編譯參數(shù)說(shuō)明

DCMAKE_INSTALL_PREFIX                                     #制定mysql的安裝根目錄,目錄在安裝的時(shí)候會(huì)自動(dòng)創(chuàng)建,這個(gè)值也可以在服務(wù)器啟動(dòng)時(shí),用--basedir來(lái)設(shè)置
DMYSQL_UNIX_ADDR                                          #服務(wù)器與本地客戶端進(jìn)行通信的Unix套接字文件,必須是絕對(duì)路徑,默認(rèn)位置/tmp/mysql.sock,可以在服務(wù)器啟動(dòng)時(shí),用--socket改變
DDEFAULT_CHARSET                       #mysql默認(rèn)使用的字符集,不指定將默認(rèn)使用Latin1西歐字符集
DDEFAULT_COLLATION                          #默認(rèn)字符校對(duì)
DWITH_EXTRA_CHARSETS                 #制定mysql拓展字符集,默認(rèn)值也是all支持所有的字符集
DWITH_MYISAM_STORAGE_ENGINE #靜態(tài)編譯MYISAM,INNOBASE,MEMORY存儲(chǔ)引擎到MYSQL服務(wù)
                                  器,這樣MYSQL就支持這三種存儲(chǔ)引擎
DWITH_INNOBASE_STORAGE_ENGINE
DWITH_MEMORY_STORAGE_ENGINE
DWITH_READLINE                   #支持readline庫(kù)
DENABLED_LOCAL_INFILE                   #允許本地倒入數(shù)據(jù),啟用加載本地?cái)?shù)據(jù)
DMYSQL_DATADIR                               #mysql數(shù)據(jù)庫(kù)存放路徑
DMYSQL-USER                                   #運(yùn)行mysql的用戶

這些編譯參數(shù)的幫助尋找方法:
http://www.mysql.com→→Documentation→→選擇對(duì)應(yīng)的版本(5.6)→→HTML Online→→View→→Installation & Upgrades→→Installing MySQL from Source →→MySQL Source-Configuration Options→→
http://dev.mysql.com/doc/refman/ ... ration-options.html

6)編譯安裝

[root@centos-6 mysql-5.6.26]#make -j 4 ; make install

       //以4個(gè)進(jìn)程來(lái)加快編譯速度,但不要超過(guò)CPU核心數(shù),編譯時(shí)間較長(zhǎng)需耐心等待

7)配置mysql

[root@centos-6 mysql-5.6.26]# chown -R mysql:mysql /usr/local/mysql/    //屬主屬組更改

[root@centos-6 mysql-5.6.26]# cp /usr/local/mysql/support-files/my-default.cnf /etc/my.cnf      //覆蓋原配置文件

[root@centos-6 mysql-5.6.26]# cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld    //復(fù)制啟動(dòng)腳本

[root@centos-6 mysql-5.6.26]# vim /etc/init.d/mysqld       //更改啟動(dòng)腳本中指定mysql位置

basedir=
datadir=
#修改為
basedir=/usr/local/mysql
datadir=/usr/local/mysql/data

[root@centos-6 mysql-5.6.26]# chkconfig mysqld on       //設(shè)置開(kāi)機(jī)啟動(dòng)

8)初始化數(shù)據(jù)庫(kù)

[root@centos-6 mysql-5.6.26]#/usr/local/mysql/scripts/mysql_install_db \
--defaults-file=/etc/my.cnf \
--basedir=/usr/local/mysql/ \
--datadir=/usr/local/mysql/data/ \
--user=mysql

查看初始化是否成功

[root@centos-6 mysql-5.6.26]# ls /usr/local/mysql/data/
ibdata1 ib_logfile0 ib_logfile1 mysql performance_schema test
[root@centos-6 mysql-5.6.26]#

[root@centos-6 mysql-5.6.26]# ln -s /usr/local/mysql/bin/* /bin/   ///這個(gè)里面是部分命令,讓系統(tǒng)直接調(diào)用

[root@centos-6 mysql-5.6.26]# /etc/init.d/mysqld restart       //啟動(dòng)數(shù)據(jù)庫(kù)

 ERROR! MySQL server PID file could not be found!
Starting MySQL.. SUCCESS!

[root@centos-6 mysql-5.6.26]# mysql_secure_installation   ////初始安全設(shè)置,設(shè)置root密碼,急用root遠(yuǎn)程訪問(wèn),刪除test數(shù)據(jù)庫(kù)等;

9)測(cè)試登陸是否正常

[root@centos-6 mysql-5.6.26]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 12
Server version: 5.6.26 Source distribution

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

3、編譯安裝php

1)解決依賴關(guān)系

yum -y install php-pear

//pear按照一定的分類(lèi)來(lái)管理pear應(yīng)用代碼庫(kù),你

的pear代碼可以組織到其中適當(dāng)?shù)哪夸浿?,其他人可以方便的檢索并分享到你的成果;pear不僅僅是一個(gè)代碼倉(cāng)庫(kù),它同時(shí)也是一個(gè)標(biāo)準(zhǔn),使用這個(gè)標(biāo)準(zhǔn)來(lái)書(shū)寫(xiě)你的php代碼,將會(huì)增強(qiáng)你的程序的可讀性,復(fù)用性,減少出錯(cuò)的幾率;Pear通過(guò)兩個(gè)類(lèi)為你搭建了一個(gè)框架,實(shí)現(xiàn)了諸如析構(gòu)函數(shù),錯(cuò)誤捕獲功能,你通過(guò)繼承就可以使用這些功能

PHP添加libmcrypt拓展

      libmcrypt加密算法擴(kuò)展庫(kù),支持DES, 3DES,RIJNDAEL, Twofish, IDEA, GOST, CAST-256, ARCFOUR, SERPENT, SAFER+等算法

      官方網(wǎng)站:http://mcrypt.hellug.gr/index.html 或者 http://mcrypt.sourceforge.net/

      在頁(yè)面上點(diǎn)擊下圖連接,可以下載最新的2.5.8版本(頁(yè)面上有個(gè)Browse All Files→→Libmcrypt)

源碼編譯安裝LNMP

2)安裝加密算法擴(kuò)展庫(kù)

[root@centos-6 lnmp]# tar xf libmcrypt-2.5.8.tar.bz2 -C /usr/local/src/ ; cd /usr/local/src/libmcrypt-2.5.8/

[root@centos-6 libmcrypt-2.5.8]# ./configure --prefix=/usr/local/libmcrypt ; make -j 4 ; make install

3)除開(kāi)上面的依賴解決之外,還需要安裝圖片,xml,字體支持基本庫(kù),使用yum去安裝,安裝的時(shí)候,這些軟件包自身也有依賴!

[root@centos-6 libmcrypt-2.5.8]# yum install -y libxml2-devel libcurl-devel libjpeg-devel libpng-devel freetype freetype-devel libzip libzip-devel

4)需要添加到庫(kù)文件路徑

[root@centos-6 libmcrypt-2.5.8]# vim /etc/ld.so.conf

添加如下內(nèi)容

include ld.so.conf.d/*.conf
/usr/local/libmcrypt/lib                      #此行添加
/usr/local/mysql/lib                          #此行添加

[root@centos-6 libmcrypt-2.5.8]# ldconfig
[root@centos-6 libmcrypt-2.5.8]# echo 'ldconfig' >> /etc/rc.local

5)加壓php

[root@centos-6 lnmp]# tar xf php-5.6.13.tar.bz2 -C /usr/local/src/ ; cd /usr/local/src/php-5.6.13
[root@centos-6 php-5.6.13]#

6)配置php編譯參數(shù)

[root@centos-6 php-5.6.13]#./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex  --enable-fpm --enable-mbstring --with-gd --enable-mysqlnd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-soap --with-gettext --with-mcrypt=/usr/local/libmcrypt --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-mysql=mysqlnd

7)編譯參數(shù)說(shuō)明

--with-config-file-path                        #設(shè)置 php.ini 的搜索路徑。默認(rèn)為 PREFIX/lib

--with-mysql                       #mysql安裝目錄,對(duì)mysql的支持

--with-mysqli                        #mysqli擴(kuò)展技術(shù)不僅可以調(diào)用MySQL的存儲(chǔ)過(guò)程、處理MySQL事務(wù),而且還可以使訪問(wèn)數(shù)據(jù)庫(kù)工作變得更加穩(wěn)定。是一個(gè)數(shù)據(jù)庫(kù)驅(qū)動(dòng)

--with-iconv-dir                     #種字符集間的轉(zhuǎn)換

--with-freetype-dir                 #打開(kāi)對(duì)freetype字體庫(kù)的支持

--with-jpeg-dir                     #打開(kāi)對(duì)jpeg圖片的支持

--with-png-dir                         #打開(kāi)對(duì)png圖片的支持

--with-zlib                       #打開(kāi)zlib庫(kù)的支持,實(shí)現(xiàn)GZIP壓縮輸出

--with-libxml-dir=/usr                    #打開(kāi)libxml2庫(kù)的支持,libxml是一個(gè)用來(lái)解析XML文檔的函數(shù)庫(kù)

--enable-xml                       #支持xml文檔

--disable-rpath                        #關(guān)閉額外的運(yùn)行庫(kù)文件

--enable-bcmath                     #打開(kāi)圖片大小調(diào)整,用到zabbix監(jiān)控的時(shí)候用到了這個(gè)模塊

--enable-shmop                      #shmop共享內(nèi)存操作函數(shù),可以與c/c++通訊

--enable-sysvsem #加上上面shmop,這樣就使得你的PHP系統(tǒng)可以處理相關(guān)的IPC函數(shù)(活動(dòng)在內(nèi)核級(jí)別)。

--enable-inline-optimization      #優(yōu)化線程

--with-curl                           #打開(kāi)curl瀏覽工具的支持

--with-curlwrappers                   #運(yùn)用curl工具打開(kāi)url流 ,新版PHP5.6已棄用

--enable-mbregex                   #支持多字節(jié)正則表達(dá)式

--enable-fpm                      #CGI方式安裝的啟動(dòng)程序,PHP-FPM服務(wù)

--enable-mbstring                    #多字節(jié),字符串的支持

--with-gd                            #打開(kāi)gd庫(kù)的支持,是php處理圖形的擴(kuò)展庫(kù),GD庫(kù)提供了一系列用來(lái)處理圖片的API,使用GD庫(kù)可以處理圖片,或者生成圖片。

--enable-gd-native-ttf                   #支持TrueType字符串函數(shù)庫(kù)

--with-openssl                         #打開(kāi)ssl支持

--with-mhash                      #支持mhash算法擴(kuò)展

--enable-pcntl                         #freeTDS需要用到的,pcntl擴(kuò)展可以支持php的多線程操作

--enable-sockets                      #打開(kāi) sockets 支持

--with-xmlrpc                      #打開(kāi)xml-rpc的c語(yǔ)言

--enable-zip                        #打開(kāi)對(duì)zip的支持

--enable-soap                         #擴(kuò)展庫(kù)通過(guò)soap協(xié)議實(shí)現(xiàn)了客服端與服務(wù)器端的數(shù)據(jù)交互操作

--with-mcrypt                      #mcrypt算法擴(kuò)展

--with-zlib-dir=/usr/local/libzip  ##指定zip庫(kù)路徑

8)編譯安裝

[root@centos-6 php-5.6.13]# make -j 3 && make install

9)配置php和php-fpm

[root@centos-6 php-5.6.13]# cp /usr/local/src/php-5.6.13/php.ini-production /usr/local/php/php.ini       //替換php配置文件
[root@centos-6 php-5.6.13]# cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf       //替換php-fpm配置文件
[root@centos-6 php-5.6.13]# chown -R nginx:nginx /usr/local/php/etc/php-fpm.conf       //修改php-fpm.conf文件權(quán)限

[root@centos-6 nginx]# vim /usr/local/php/etc/php-fpm.conf        //修改php-fpm運(yùn)行帳號(hào)為nginx

user = nobody

group = nobody

改為

user = nginx

group = nginx

10)配置php-fpm啟動(dòng)腳本并配置隨機(jī)啟動(dòng)

[root@centos-6 php-5.6.13]# cp /usr/local/src/php-5.6.13/sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
[root@centos-6 php-5.6.13]# chmod +x /etc/init.d/php-fpm
[root@centos-6 php-5.6.13]# chkconfig php-fpm on
[root@centos-6 php-5.6.13]# /etc/init.d/php-fpm start
Starting php-fpm done

11)測(cè)試php解釋是否生效

[root@centos-6 php-5.6.13]# echo "<?php phpinfo(); ?>" > /usr/local/nginx/html/info.php

源碼編譯安裝LNMP

另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內(nèi)外云服務(wù)器15元起步,三天無(wú)理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國(guó)服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡(jiǎn)單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場(chǎng)景需求。

網(wǎng)站名稱:源碼編譯安裝LNMP-創(chuàng)新互聯(lián)
網(wǎng)頁(yè)路徑:http://www.rwnh.cn/article44/dopcee.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供靜態(tài)網(wǎng)站、網(wǎng)站改版、手機(jī)網(wǎng)站建設(shè)、虛擬主機(jī)Google、做網(wǎng)站

廣告

聲明:本網(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í)需注明來(lái)源: 創(chuàng)新互聯(lián)

網(wǎng)站建設(shè)網(wǎng)站維護(hù)公司
扬中市| 城固县| 安达市| 镇宁| 诸城市| 安宁市| 华安县| 潞西市| 广平县| 体育| 蒲江县| 东乡族自治县| 广宁县| 喜德县| 金溪县| 忻州市| 东乌珠穆沁旗| 苏尼特左旗| 双鸭山市| 二手房| 随州市| 同德县| 大宁县| 长治市| 柳林县| 汽车| 抚远县| 德兴市| 琼海市| 房产| 东莞市| 婺源县| 乌拉特前旗| 望江县| 吴江市| 南昌市| 闽清县| 敦化市| 岐山县| 辽中县| 阳新县|