nginx php動態編譯加載模塊.

#Nginx動態編譯加載模塊步驟php

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

#[root@centos7 ~]# /opt/app/lnmp/nginx-1.12.0/sbin/nginx -Vcentos

#nginx version: nginx/1.12.0app

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

#built with OpenSSL 1.0.2k  26 Jan 2017ui

#TLS SNI support enabledcentos7

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

#debug

#下載nginx-1.12.0源碼包,而且解壓.好比加載--with-http_ssl_module模塊ssl

#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

[root@centos7 gd] /opt/app/lnmp/php-7.1.5/bin/phpize  回車.

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

[root@centos7 gd] ./configure --with-php-config=/opt/app/lnmp/php-7.1.5/bin/php-config

[root@centos7 gd] make && make install

@編譯完成後生成的文件存放在,完成沒有報錯會提示以下.

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

@ 修改php.ini文件extension支持gd.so

相關文章
相關標籤/搜索