日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

nginx小总结(五)

發(fā)布時(shí)間:2025/5/22 编程问答 15 豆豆
生活随笔 收集整理的這篇文章主要介紹了 nginx小总结(五) 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

2019獨(dú)角獸企業(yè)重金招聘Python工程師標(biāo)準(zhǔn)>>>

nginx連接php

nginx本身只支持靜態(tài)的文本,當(dāng)處理動(dòng)態(tài)網(wǎng)頁的時(shí)候,則需要借助于其他模塊(插件),比如動(dòng)態(tài)的php,就需要fast-CGI模塊,fast-CGI去連接php-fpm,首先,我們得編譯安裝php

[root@host2 ~]# rpm -qa php ? ? ? ? ?如果之前安裝過,需要卸載掉重新安裝!

gcc ?make等都是要按裝的

################################################

tar zxf libiconv-1.13.1.tar.gz ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?#加強(qiáng)系統(tǒng)對支持字符編碼轉(zhuǎn)換的功能
cd libiconv-1.13.1/
./configure --libdir=/usr/local/lib64
make && make install

###################################################

如果安裝的是1.14

wget?http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz tar?xvf?libiconv-1.14.tar.gz cd?libiconv-1.14 make?&&?sudo?make?install

如果你的glibc版本在2.16以上,make時(shí)很有可能出現(xiàn)如下錯(cuò)誤

In?file?included?from?progname.c:26:0: ./stdio.h:1010:1:?error:?‘gets’?undeclared?here?(not?in?a?function) _GL_WARN_ON_USE?(gets,?"gets?is?a?security?hole?-?use?fgets?instead"); ^

參考這里的方法,下載patch文件,解壓后打上patch即可。

在libiconv-1.14目錄下執(zhí)行

wget?-O?-?http://blog.atime.me/static/resource/libiconv-glibc-2.16.patch.gz?|?gzip?-d?-?|?patch?-p0

或者考慮直接注釋掉srclib/stdio.in.h文件的第698行(應(yīng)該沒問題),即

//??_GL_WARN_ON_USE?(gets,?"gets?is?a?security?hole?-?use?fgets?instead");


#################################################
tar jxf libmcrypt-2.5.8.tar.bz2 ? ? ? ? ? ? ? ? ? ? ? ? ? ?# mcrypt mhash是php加密算法擴(kuò)展庫
cd libmcrypt-2.5.8
./configure –libdir=/usr/local/lib64
make && make install
cd libltdl
./configure --libdir=/usr/local/lib64 --enable-ltdl-install
make && make install

#################################################

tar zxvf mhash-0.9.9.9.tar.gz
cd mhash-0.9.9.9
./configure --libdir=/usr/local/lib64
make && make install

#################################################

[root@host2 mhash-0.9.9.9]# vim /etc/ld.so.conf ? ? ? ?在里面添加

include /usr/local/lib64

ldconfig /usr/local/lib64 ? ? ? ? ? ? ? ? ?讓系統(tǒng)重新加載lib庫,必須有

tar zxvf mcrypt-2.6.8.tar.gz
cd mcrypt-2.6.8/
./configure --libdir=/usr/local/lib64
make && make install

yum install net-snmp-devel curl-devel libxml2-devel libpng-devel libjpeg-devel freetype-
devel gmp-devel openldap-devel -y

php的準(zhǔn)備工作已經(jīng)OK!

useradd -M -s /sbin/nologin www

tar jxf php-5.3.6.tar.bz2cd php-5.3.6
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql/?--with-openssl --with-snmp --with-gd --with-zlib --with-curl --with-libxml-dir --with-png-dir --with-jpeg-dir --with-freetype-dir --without-pear --with-gettext --with-gmp --enable-inline-optimization --enable-soap --enable-ftp --enable-sockets --enable-mbstring --with-mysqli=/usr/local/mysql/bin/mysql_config --enable-fpm --with-fpm-user=www --with-fpm-group=www --with-libdir=lib64 --with-ldap --with-ldap-sasl --with-mcrypt --with-mhash

php-5.5.15#?./configure?--prefix=/usr/local/webserver/php?--with-config-file-path=/usr/local/webserver/php/etc?--with-openssl?--with-snmp?--with-gd?--with-zlib?--with-curl?--with-libxml-dir?--with-png-dir?--with-jpeg-dir?--with-freetype-dir=/usr/local/webserver/freetype/?--without-pear?--with-gettext?--with-gmp?--enable-inline-optimization?--enable-soap?--enable-ftp?--enable-sockets?--enable-mbstring?--with-mysqli=/usr/local/mysql/bin/mysql_config?--enable-fpm?--with-fpm-user=phphuser?--with-fpm-group=phpuser??--with-ldap?--with-ldap-sasl?--with-mcrypt=/usr/local/webserver/libmcrypt/?--with-mhash=/usr/local/webserver/mhash?--with-mysql

各種參數(shù)、重點(diǎn)是--enable-fpm,還有,那個(gè)mysql現(xiàn)在我們是沒有安裝的可以去掉,在實(shí)際中,還是應(yīng)該先安裝mysql!


make ZEND_EXTRA_LIBS='-liconv'
make install
wget http://pear.php.net/go-pear.phar
/usr/local/webserver/php/bin/php go-pear.phar

貌似這篇只能說道php的安裝了,未完待續(xù)。。。。




























































轉(zhuǎn)載于:https://my.oschina.net/fsxchen/blog/111653

總結(jié)

以上是生活随笔為你收集整理的nginx小总结(五)的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。