LNMP 安裝

[root@localhost tools]# tar xvf pcre-8.12.tar.bz2 
[root@localhost tools]# cd pcre-8.12
[root@localhost pcre-8.12]# ./configure && make && make install
[root@localhost tools]# useradd www
[root@localhost tools]# yum install openssl* -y
[root@localhost tools]# tar xvf nginx-1.6.0.tar.gz
[root@localhost tools]# tar xvf ngx_cache_purge-1.3.tar.gz

# debug
CFLAGS="$CFLAGS -g"

[root@localhost tools]# cd nginx-1.6.0

[root@localhost nginx-1.6.0]# ./configure --user=www --group=www --add-module=/data/tools/ngx_cache_purge-1.3/ --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_flv_module

[root@localhost nginx-1.6.0]# make && make install

[root@localhost tools]# tar xvf autoconf-2.13.tar.gz 

[root@localhost tools]# cd autoconf-2.13

[root@localhost autoconf-2.13]# ./configure && make && make install

[root@localhost tools]# tar xvf libiconv-1.14.tar.gz 

[root@localhost tools]# cd libiconv-1.14

[root@localhost libiconv-1.14]# ./configure && make && make install

[root@localhost tools]# tar xvf libmcrypt-2.5.8.tar.gz 

[root@localhost tools]# cd libmcrypt-2.5.8

[root@localhost libmcrypt-2.5.8]# ./configure && make && make install

[root@localhost libmcrypt-2.5.8]# /sbin/ldconfig

[root@localhost libmcrypt-2.5.8]# cd libltdl/

[root@localhost libltdl]# ./configure --enable-ltdl-install && make && make install

[root@localhost tools]# tar xvf mhash-0.9.9.9.tar.gz 

[root@localhost tools]# cd mhash-0.9.9.9

[root@localhost mhash-0.9.9.9]# ./configure && make && make install

[root@localhost tools]#  ln -s /usr/local/lib/libmcrypt.la /usr/lib/libmcrypt.la
[root@localhost tools]#  ln -s /usr/local/lib/libmcrypt.so /usr/lib/libmcrypt.so
[root@localhost tools]# ln -s /usr/local/lib/libmcrypt.so.4 /usr/lib/libmcrypt.so.4
[root@localhost tools]# ln -s /usr/local/lib/libmcrypt.so.4.4.8 /usr/lib/libmcrypt.so.4.4.8
[root@localhost tools]# ln -s /usr/local/lib/libmhash.a /usr/lib/libmhash.a
[root@localhost tools]# ln -s /usr/local/lib/libmhash.la /usr/lib/libmhash.la
[root@localhost tools]# ln -s /usr/local/lib/libmhash.so /usr/lib/libmhash.so
[root@localhost tools]# ln -s /usr/local/lib/libmhash.so.2 /usr/lib/libmhash.so.2
[root@localhost tools]# ln -s /usr/local/lib/libmhash.so.2.0.1 /usr/lib/libmhash.so.2.0.1

[root@localhost tools]# tar xvf mcrypt-2.6.8.tar.gz 

[root@localhost tools]# cd mcrypt-2.6.8

[root@localhost mcrypt-2.6.8]# ./configure && make && make install  

*** Could not run libmcrypt test program, checking why...
*** The test program compiled, but did not run. This usually means
*** that the run-time linker is not finding LIBMCRYPT or finding the wrong
*** version of LIBMCRYPT. If it is not finding LIBMCRYPT, you'll need to set your
*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point
*** to the installed location  Also, make sure you have run ldconfig if that
*** is required on your system
***
*** If you have an old version installed, it is best to remove it, although
*** you may also be able to get things to work by modifying LD_LIBRARY_PATH
***
configure: error: *** libmcrypt was not found
[root@localhost mcrypt-2.6.8]# export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH

[root@localhost mcrypt-2.6.8]# ln -s /usr/local/bin/libmcrypt-config /usr/bin/libmcrypt-config

[root@localhost mcrypt-2.6.8]# ./configure && make && make install

[root@localhost tools]# wget http://www.ijg.org/files/jpegsrc.v8d.tar.gz 
[root@localhost tools]# tar xvf jpegsrc.v8d.tar.gz 

[root@localhost tools]# cd jpeg-8d/

[root@localhost jpeg-8d]# ./configure --prefix=/usr/local/jpeg

[root@localhost php-5.5.13]# ./configure --prefix=/usr/local/php --with-iconv --with-gd --with-zlib --with-pcre-dir --with-gettext --enable-fpm --with-jpeg-dir=/usr/local/jpeg/ --with-mysqli=/usr/bin/mysql_config --enable-xml --enable-

sockets --enable-ftp --with-curl --with-curlwrappers --with-pear --enable-calendar --enable-mbstring --enable-bcmath --enable-exif --with-freetype-dir --with-libXML-dir --enable-zip --enable-soap --with-XMLrpc --with-zlib-dir --enable-

gd-native-ttf --enable-magic-quotes --with-mhash --with-gmp --enable-inline-optimization --with-openssl --enable-sigchild --enable-sysvsem --enable-sysvshm --enable-zend-multibyte --enable-mbregex --enable-wddx --enable-shmop --without-

pear --with-mysql --with-pdo-mysql --enable-maintainer-zts


[root@localhost php-5.5.13]# make ZEND_EXTRA_LIBS='-liconv'

[root@localhost php-5.5.13]# make install

[root@localhost php-5.5.13]# cp php.ini-production /usr/local/php/etc/php.ini

[root@localhost php-5.5.13]# cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf

安裝過程中出現的錯誤和解決方法

錯誤(一)
configure: error: Please reinstall the libcurl distribution -
easy.h should be in <curl-dir>/include/curl/

[root@localhost php-5.5.13]#  yum -y install curl-devel

錯誤(二)
If configure fails try --with-vpx-dir=<DIR>
configure: error: jpeglib.h not found.

錯誤(三)
If configure fails try --with-vpx-dir=<DIR>
configure: error: jpeglib.h not found.

[root@localhost php-5.5.13]# yum install libjpeg
[root@localhost php-5.5.13]# cp -frp /usr/lib64/libjpeg.* /usr/lib/
[root@localhost php-5.5.13]#  cp -frp /usr/lib64/libpng* /usr/lib/

錯誤(四)
configure: error: Unable to locate gmp.h
[root@localhost php-5.5.13]# yum install gmp-devel

錯誤(五)
Configure: error: Unable to locate gmp.h
Solutions :
[root@localhost php-5.5.13]# yum install gmp-devel


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章