CentOS6 编译安装LNMP步骤(2)


# mysql5.1
./configure \
--prefix=/data/service/mysql \
--localstatedir=/data/data/mysql \
--sysconfdir=/data/service/mysql/etc \
--with-mysqld-user=mysql \
--without-debug \
--with-big-tables \
--with-unix-socket-path=/tmp/mysql.sock \
--with-charset=gbk \
--with-collation=gbk_chinese_ci \
--with-extra-charsets=all \
--with-plugins=partition \
--enable-static \
--with-client-ldflags=-all-static \
--with-tcp-port=3306


/data/service/mysql/mysqld start
/data/service/mysql/mysqld restart
#/data/service/mysql/bin/mysqladmin -uroot password
/data/service/mysql/mysqld stop


# libmcrypt
./configure --prefix=/data/service/common/libmcrypt
make && make install
ln -s /data/service/common/libmcrypt/lib /data/service/common/libmcrypt/lib64
echo "/data/service/common/libmcrypt/lib64" >> \
/etc/ld.so.conf.d/service_lib.conf && ldconfig


# mhash
./configure --prefix=/data/service/common/mhash
make && make install
ln -s /data/service/common/mhash/lib /data/service/common/mhash/lib64
echo "/data/service/common/mhash/lib64" >> \
/etc/ld.so.conf.d/service_lib.conf && ldconfig


# mcrypt
#LD_LIBRARY_PATH=/data/service/common/libmcrypt/lib:/data/service/common/mhash/lib \
LDFLAGS="-L/data/service/common/mhash/lib/ -I/data/service/common/mhash/include/" \
CFLAGS="-I/data/service/common/mhash/include/" \
./configure --prefix=/data/service/common/mcrypt \
--with-libmcrypt-prefix=/data/service/common/libmcrypt
make && make install
ln -s /data/service/common/mcrypt/lib /data/service/common/mcrypt/lib64
echo "/data/service/common/mcrypt/lib64" >> \
/etc/ld.so.conf.d/service_lib.conf && ldconfig


# libpng
#下面这句,测试不能执行,否则就会报告下面的错误,而且无法安装到/usr/lib/libpng/下
#cp scripts/makefile.linux makefile
./configure --prefix=/data/service/common/libpng --enable-shared --enable-static
make && make install
ln -s /data/service/common/libpng/lib /data/service/common/libpng/lib64
echo "/data/service/common/libpng/lib64" >> \
/etc/ld.so.conf.d/service_lib.conf && ldconfig


# freetype
./configure --prefix=/data/service/common/freetype --enable-shared --enable-static
make && make install
ln -s /data/service/common/freetype/lib /data/service/common/freetype/lib64
echo "/data/service/common/freetype/lib64" >> \
/etc/ld.so.conf.d/service_lib.conf && ldconfig


# libjpeg
./configure --prefix=/data/service/common/libjpeg --enable-shared --enable-static
make && make install
ln -s /data/service/common/libjpeg/lib /data/service/common/libjpeg/lib64
echo "/data/service/common/libjpeg/lib64" >> \
/etc/ld.so.conf.d/service_lib.conf && ldconfig


# gd
yum install libXpm-devel fontconfig-devel
PATH=/data/service/common/libpng/bin/:$PATH \
LDFLAGS="-L/data/service/common/libpng/lib/" \
CFLAGS="-I/data/service/common/libpng/include/" \
./configure --prefix=/data/service/common/gd \
--enable-shared --enable-static \
--with-png=/data/service/common/libpng \
--with-freetype=/data/service/common/freetype \
--with-jpeg=/data/service/common/libjpeg
make && make install
ln -s /data/service/common/gd/lib /data/service/common/gd/lib64
echo "/data/service/common/gd/lib64" >> \
/etc/ld.so.conf.d/service_lib.conf && ldconfig


# pcre
./configure --prefix=/data/service/common/pcre \
--enable-shared --enable-static
make && make install
ln -s /data/service/common/pcre/lib /data/service/common/pcre/lib64
echo "/data/service/common/pcre/lib64" >> \
/etc/ld.so.conf.d/service_lib.conf && ldconfig


# php5.3
./configure  \
--prefix=/data/service/phpfpm \
--with-config-file-path=/data/service/phpfpm/etc \
--with-libdir=lib64 \
--with-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-mcrypt=/data/service/common/libmcrypt \
--with-mhash=/data/service/common/mhash \
--with-gd=/data/service/common/gd \
--with-pcre-dir=/data/service/common/pcre \
--with-freetype-dir=/data/service/common/freetype \
--with-jpeg-dir=/data/service/common/libjpeg \
--with-png-dir=/data/service/common/libpng \
--with-openssl \
--with-zlib \
--with-curl \
--with-curlwrappers \
--with-xmlrpc \
--with-bz2 \
--with-gettext \
--with-xpm-dir \
--enable-fpm \
--enable-ftp \
--enable-sockets \
--enable-xml \
--enable-bcmath \
--enable-shmop \
--enable-sysvsem \
--enable-inline-optimization \
--enable-mbregex \
--enable-mbstring \
--enable-gd-native-ttf \
--enable-sockets \
--enable-zip \
--enable-soap \
--enable-pcntl \
--disable-rpath

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/0e1d6b1546178c41635338ec1750ffee.html