lnmp环境搭建笔记

yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers


mysql安装
./configure \
--prefix=/usr/local/mysql \
--with-extra-charsets=complex \
--enable-thread-safe-client \
--enable-assembler \
--with-mysqld-ldflags=-all-static \
--with-charset=utf8 \
--enable-thread-safe-client \
--with-big-tables \
--with-readline \
--with-ssl \
--with-embedded-server \
--enable-local-infile

make && make install

/usr/local/mysql/bin/mysql_install_db  --user=mysql


php相关依赖
tar zxvf libiconv-1.13.1.tar.gz


./configure
 --prefix=/usr/
make && make install



tar zxvf libmcrypt-2.5.8.tar.gz

./configure --prefix=/usr/
make && make install
/sbin/ldconfig
cd libltdl/
./configure --enable-ltdl-install --prefix=/usr/
make && make install
cd ../../

tar zxvf mhash-0.9.9.9.tar.gz
cd mhash-0.9.9.9/
./configure --prefix=/usr/
make && make install



gzip -cd php-5.2.17-fpm-0.5.14.diff.gz | patch -d php-5.2.17 -p1

php安装
./configure  \
--prefix=/usr/local/php \
--enable-fastcgi \
--enable-fpm \
--enable-discard-path \
--enable-force-cgi-redirect \
--with-mysql=/usr/local/mysql/ \
--with-mysqli=/usr/local/mysql/bin/mysql_config \
--with-iconv-dir \
--with-freetype-dir \
--with-jpeg-dir \
--with-png-dir \
--with-gd \
--with-zlib \
--with-libxml-dir \
--with-curl \
--with-curlwrappers \
--with-openssl \
--with-mhash \
--with-xmlrpc \
--with-mcrypt \
--with-ldap \
--with-ldap-sasl \
--enable-xml \
--disable-rpath \
--enable-discard-path \
--enable-safe-mode \
--enable-bcmath \
--enable-shmop \
--enable-sysvsem \
--enable-inline-optimization \
--enable-mbregex \
--enable-mbstring \
--enable-gd-native-ttf \
--enable-ftp \
--enable-pcntl \
--enable-sockets \
--enable-zip \
--disable-debug \
--disable-ipv6
make ZEND_EXTRA_LIBS='-liconv'
make install



nginx 安装
yum install pcre pcre-devel -y
sed -i "/CFLAGS=\"\$CFLAGS -g\"/s/^/#&/" auto/cc/gcc
./configure \
--user=www \
--group=www \
--prefix=/usr/local/nginx \
--with-http_stub_status_module \
--with-http_ssl_module  \
--with-md5=/usr/lib \
--with-sha1=/usr/lib
make
make install
 

本文出自 “Ach4ng” 博客,请务必保留此出处http://ach4ng.blog.51cto.com/5617472/1010725

你可能感兴趣的:(LNMP)