php5.5.9+openresty-1.21.4.1+openssl-1.0.1s全手动编译

1.Mysql安装
echo ">>>>>>>>> install mysql >>>>>>>>>"

tar xvf mysql-5.5.30.tar.gz

cd mysql-server-mysql-5.5.30
cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/lnmp/mysql -DENABLE_DTRACE=OFF
make -j5 && make install 
2.Zlib安装
echo ">>>>>>>>> install zlib >>>>>>>>>"
tar xvf zlib-1.2.5.tar.gz
cd zlib-1.2.5
./configure --prefix=/usr/local/lnmp/zlib
make -j5 && make install
3.libpng 安装
echo ">>>>>>>>> install libpng >>>>>>>>>"
tar xvf libpng-1.6.9.tar.gz
cd libpng-1.6.9
./configure --prefix=/usr/local/lnmp/libpng --with-zlib-prefix=/usr/local/lnmp/zlib/
make -j5 && make install
echo "/usr/local/lnmp/libpng/lib/" >> /etc/ld.so.conf
ldconfig
4. jpeg 安装
echo ">>>>>>>>> install jpeg >>>>>>>>>"
mkdir -p /usr/local/lnmp/jpeg/bin
mkdir -p /usr/local/lnmp/jpeg/lib
mkdir -p /usr/local/lnmp/jpeg/include
mkdir -p /usr/local/lnmp/jpeg/man/man1
tar xvf jpegsrc.v6b.tar.gz
cd jpeg-6b
\cp /usr/share/libtool/config/config.sub config.sub 
\cp /usr/share/libtool/config/config.guess config.guess 
./configure --prefix=/usr/local/lnmp/jpeg --enable-shared --enable-static
make -j5 && make install
5.freetype 安装
echo ">>>>>>>>> install freetype >>>>>>>>>"
tar xvf freetype-2.3.5.tar.gz 
cd freetype-2.3.5
mkdir -p /usr/local/lnmp/freetype/include/freetype2/freetype/config
./configure --prefix=/usr/local/lnmp/freetype --enable-shared --enable-static
make -j5 && make install
6.pcre 安装
echo ">>>>>>>>> install pcre >>>>>>>>>"
unzip pcre-8.10.zip
cd pcre-8.10
./configure --prefix=/usr/local/lnmp/pcre 
make -j5 && make install
7.openssl-1.0.1s安装
echo ">>>>>>>>> install openssl-1.0.1s >>>>>>>>>"
tar xvf openssl-1.0.1s.tar.gz
cd openssl-1.0.1s
./config  shared zlib --prefix=/usr/local/lnmp/ssl-1.0.1s
make && make install
#echo "/usr/local/ssl/lib" >> /etc/ld.so.conf
#ldconfig
8.libmcrypt安装
echo ">>>>>>>>> install libmcrypt >>>>>>>>>"
tar xvf  libmcrypt-2.5.8.tar.gz
cd libmcrypt-2.5.8
./configure --prefix=/usr/local/lnmp/libmcrypt && make -j5 && make install
9.mhash安装
echo ">>>>>>>>> install mhash >>>>>>>>>"
tar xvf mhash-0.9.9.9.tar.gz
cd mhash-0.9.9.9
./configure --prefix=/usr/local/lnmp/mhash
make -j5 && make install
10.mcrypt安装
echo ">>>>>>>>> install mcrypt >>>>>>>>>"
tar xvf mcrypt-2.6.8.tar.gz
cd mcrypt-2.6.8
export LDFLAGS="-L/usr/local/lnmp/mhash/lib/"
export CFLAGS="-I/usr/local/lnmp/mhash/include/"
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lnmp/libmcrypt/lib
./configure --prefix=/usr/local/lnmp/mcrypt/ --with-libmcrypt-prefix=/usr/local/lnmp/libmcrypt/
make -j5 && make install
11.gmp安装
echo ">>>>>>>>> install gmp >>>>>>>>>"
tar xvf gmp-4.1.4.tar.gz
cd gmp-4.1.4
./configure --prefix=/usr/local/lnmp/gmp/
make -j5 && make install
12.gd安装
echo ">>>>>>>>> install gd >>>>>>>>>"
tar xvf libgd-2.3.2.tar.gz
cd libgd-2.3.2
./configure --prefix=/usr/local/lnmp/gd -with-jpeg=/usr/local/lnmp/jpeg -with-png=/usr/local/lnmp/libpng/ -with-zlib -with-freetype=/usr/local/lnmp/freetype
make -j5 && make install
13.PHP5.5.9安装
echo ">>>>>>>>>install php >>>>>>>>>"
tar xvf  php-5.5.9.tar.gz
cd php-5.5.9
./configure \
--prefix=/usr/local/lnmp/php-5.5.9 \
--with-mysql \
--with-mysqli \
--with-pdo-mysql \
--with-mcrypt=/usr/local/lnmp/libmcrypt/ \
--with-gmp=/usr/local/lnmp/gmp \
--enable-fpm \
--enable-exif \
--enable-ftp \
--enable-mbstring \
--enable-soap \
--enable-zip \
--enable-sockets \
--enable-xml \
--enable-sigchild \
--enable-libgcc \
--enable-bcmath \
--enable-calendar \
--enable-dba \
--enable-ftp \
--enable-gd-jis-conv \
--enable-pcntl \
--enable-shmop \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
--enable-wddx \
--enable-mysqlnd \
--with-litespeed \
--with-kerberos \
--with-pcre-regex \
--with-bz2 \
--with-readline \
--with-xsl \
--with-pcre-dir \
--with-gd=/usr/local/lnmp/gd \
--with-curl \
--with-jpeg-dir=/usr/local/lnmp/jpeg \
--with-freetype-dir=/usr/local/lnmp/freetype \
--with-xmlrpc \
--with-libxml-dir \
--with-mhash=/usr/local/lnmp/mhash \
--with-zlib-dir=/usr/local/lnmp/zlib \
--with-png-dir=/usr/local/lnmp/libpng/ \
--with-fpm-user=daemon \
--with-fpm-group=daemon \
--with-openssl=/usr/local/lnmp/ssl-1.0.1s/ \
--enable-opcache=no
make -j5 && make install

cp php.ini-production /usr/local/lnmp/php-5.5.9/lib/php.ini
cp /usr/local/lnmp/php-5.5.9/etc/php-fpm.conf.default /usr/local/lnmp/php-5.5.9/etc/php-fpm.conf
14.libevent 安装
echo ">>>>>>>>> install libevent >>>>>>>>>"
tar xvf libevent-2.0.21-stable.tar.gz 
cd libevent-2.0.21-stable
./configure --prefix=/usr/local/lnmp/libevent && make -j5 && make install
15.memcache扩展安装(根据需要)
echo ">>>>>>>>> install memcache >>>>>>>>>"
tar xvf memcache-2.2.7.tgz 
cd memcache-2.2.7
/usr/local/lnmp/php-5.5.9/bin/phpize
./configure --prefix=/usr/local/lnmp/memcache --enable-memcache --with-php-config=/usr/local/lnmp/php-5.5.9/bin/php-config
make -j5 && make install
16、ImageMagick扩展安装(根据需要)
echo ">>>>>>>>> install ImageMagick >>>>>>>>>"
tar xvf ImageMagick-6.8.8-5.tar.gz
cd ImageMagick-6.8.8-5
export CPPFLAGS="-I/usr/local/lnmp/jpeg/include/"
export LDFLAGS="-L/usr/local/lnmp/jpeg/lib"
export FREETYPE_CFLAGS=/usr/local/lnmp/freetype/include/
export FREETYPE_LIBS=/usr/local/lnmp/freetype/lib/
./configure --prefix=/usr/local/lnmp/ImageMagick
make -j5 && make install

echo ">>>>>>>>> install imagick >>>>>>>>>"
tar xvf  imagick-3.1.2.tgz
cd imagick-3.1.2
/usr/local/lnmp/php-5.5.9/bin/phpize
./configure  --with-php-config=/usr/local/lnmp/php-5.5.9/bin/php-config  --with-imagick=/usr/local/lnmp/ImageMagick/
make -j5 && make install

编辑文件:/usr/local/lnmp/php-5.5.9/lib/php.ini

增加扩展:

extension_dir = /usr/local/lnmp/php-5.5.9/lib/php/extensions/no-debug-non-zts-20121212/
extension = memcache.so
extension = imagick.so
17.openresty 1.21.4.1安装

1、下载

pcre下载地址:http://www.pcre.org/

zlib下载地址:http://zlib.net/

openssl下载地址: https://www.openssl.org/

openresty下载地址: http://openresty.org/cn/download.html

严格按照下面下载版本如下:

zlib-1.2.11.tar.gz

pcre-8.42.tar.gz

openssl-1.1.0h.tar.gz

openresty-1.21.4.1.tar.gz

2、编译依赖

(1)zlib

tar xvf zlib-1.2.11.tar.gz
cd zlib-1.2.11
./configure --prefix=/usr/local/lnmp/zlib-1.2.11 --shared
make -j4 && make install

(2)pcre

tar xvf pcre-8.42.tar.gz
cd pcre-8.42
./configure --prefix=/usr/local/lnmp/pcre-8.42
make -j4 && make install

(3)OpenSSL_1_1_0h

tar xvf openssl-OpenSSL_1_1_0h.tar.gz
cd openssl-OpenSSL_1_1_0h
./config shared zlib --prefix=/usr/local/lnmp/openssl-1.1.0h
make -j4 && make install

(4)openresty

tar xvf openresty-1.21.4.1.tar.gz
cd openresty-1.21.4.1
./configure \
    --prefix=/usr/local/lnmp/openresty  \
    --with-cc-opt='-DNGX_LUA_USE_ASSERT -DNGX_LUA_ABORT_AT_PANIC -O' \
    --with-pcre-jit \
    --with-stream \
    --with-stream_ssl_module \
    --with-stream_ssl_preread_module \
    --with-http_v2_module \
    --with-http_ssl_module \
    --with-http_stub_status_module \
    --with-http_realip_module \
    --with-http_addition_module \
    --with-http_auth_request_module \
    --with-http_secure_link_module \
    --with-http_random_index_module \
    --with-http_gzip_static_module \
    --with-http_sub_module \
    --with-http_dav_module \
    --with-http_flv_module \
    --with-http_mp4_module \
    --with-http_gunzip_module \
    --with-select_module \
    --with-luajit-xcflags="-DLUAJIT_NUMMODE=2 -DLUAJIT_ENABLE_LUA52COMPAT" \
    --with-pcre=/opt/rh/lnmptar/pcre-8.42 \
    --with-zlib=/opt/rh/lnmptar/zlib-1.2.11 \
    --with-openssl=/opt/rh/lnmptar/openssl-OpenSSL_1_1_0h \
    --with-openssl-opt=-g \
    --with-zlib-opt=-g \
    -j4
make -j4 && make install

猜你喜欢

转载自blog.csdn.net/whj99154562/article/details/128739850
今日推荐