nginx php動態編譯載入模組.

來源:互聯網
上載者:User

標籤:php   nginx   動態編譯   

#Nginx動態編譯載入模組步驟

#查看目前Nginx版本及編譯模組

#[[email protected] ~]# /opt/app/lnmp/nginx-1.12.0/sbin/nginx -V

#nginx version: nginx/1.12.0

#built by gcc 4.8.5 20150623 (Red Hat 4.8.5-11) (GCC) 

#built with OpenSSL 1.0.2k  26 Jan 2017

#TLS SNI support enabled

#configure arguments: --prefix=/opt/app/lnmp/nginx-1.12.0 --with-pcre=/opt/app/lnmp/pcre-8.40

#

#下載nginx-1.12.0源碼包,並且解壓.比如載入--with-http_ssl_module模組

#cd nginx-1.12.0

#./configure --prefix=/opt/app/lnmp/nginx-1.12.0 --with-pcre=/opt/app/lnmp/pcre-8.40 --with-http_ssl_module

#make  

###########################切記不能make install#####################

#此時源碼包裡的objs多了一個nginx開機檔案.進入cd /opt/download/nginx-1.12.0/objs

#備份原來二進位nginx開機檔案.

#\mv /opt/app/lnmp/nginx-1.12.0/sbin/nginx /opt/app/lnmp/nginx-1.12.0/sbin/nginx.bak

#\cp nginx  /opt/app/lnmp/nginx-1.12.0/sbin/nginx

#平滑啟動: /opt/app/lnmp/nginx-1.12.0/sbin/nginx -s reload

----若是平滑升級則在平滑重啟前,源碼目錄下make upgrade .源碼包要比現有包新穩定版.


動態編譯php

@進入源碼包.

/opt/download/php-7.1.5/ext && ls

@進入需要載入的模組.如何GD

cd gd

@然後用原來編譯安裝好的php啟動目錄下的phpize產生configure

[[email protected] gd] /opt/app/lnmp/php-7.1.5/bin/phpize  斷行符號.

@把編譯配置加入安裝好的php-config

[[email protected] gd] ./configure --with-php-config=/opt/app/lnmp/php-7.1.5/bin/php-config

[[email protected] gd] make && make install

@編譯完成後產生的檔案存放在,完成沒有報錯會提示如下.

/opt/app/lnmp/php-7.1.5/lib/php/extensions/no-debug-non-zts-20160303/

@ 修改php.ini檔案extension支援gd.so


nginx 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.