編譯靜態php7.4.6

編譯靜態php7.4.6
系統 centos6.0

1、yum安裝依賴
yum install gcc gcc-c++ automake libtool glibc-static byacc zlib-devel zlib-static bzip2-devel  bzip2-static zip unzip bzip2 ncurses-devel ncurses-static readline-devel readline-static libxml2-devel libxml2-static libxslt-devel freetype-devel libcurl-devel 

2、編譯openssl
tar -xvf openssl-1.1.0i.tar.gz
cd openssl-1.1.0i
./config --prefix=/root/php/depend/openssl -fPIC no-shared
make && make install

3、編譯libzip
tar -xvf libzip-1.3.2.tar.gz
cd libzip-1.3.2
./configure --prefix=/root/php/depend/libzip --disable-shared
make && make install

4、編譯sqlite3
unzip sqlite-amalgamation-3310100.zip
cd sqlite-amalgamation-3310100
gcc -c sqlite3.c -o sqlite3.o
ar -r libsqlite3.a sqlite3.o

5、編譯oniguruma
tar -xvf oniguruma-6.9.4.tar.gz
cd oniguruma-6.9.4
./autogen.sh
./configure --prefix=/root/php/depend/onig --disable-shared
make && make install

6、編譯libjpeg
tar -xvf jpegsrc.v9d.tar.gz
cd jpeg-9d
./configure --prefix=/root/php/depend/jpeg --disable-shared
make && make install

7、編譯libpng
tar -xvf libpng-1.6.37.tar.gz
cd libpng-1.6.37
./configure --prefix=/root/php/depend/png --disable-shared
make && make install

8、編譯krb5
tar -xvf krb5-1.14.4.tar.gz
cd krb5-1.14.4
./configure --prefix=/root/php/depend/krb5 --disable-shared --enable-static LIBS=-lm
make && make install

9、編譯php
tar -xvf php-7.4.6.tar.bz2
cd php-7.4.6
export LDFLAGS="-L/root/php/depend/openssl/lib -L/root/php/depend/krb5/lib -L/root/php/sqlite-amalgamation-3310100 -L/root/php/depend/onig/lib -L/root/php/depend/jpeg/lib -L/root/php/depend/libzip/lib -L/root/php/depend/png/lib" && ./configure --prefix=/root/php/php --with-config-file-path=/etc --with-fpm-user=www --with-fpm-group=www --with-curl --with-freetype --enable-gd --with-gettext --with-iconv-dir --with-kerberos --with-libdir=lib64 --with-libxml --with-mysqli --with-openssl --with-pcre-regex --with-pdo-mysql --with-pdo-sqlite --with-pear --with-jpeg --with-xmlrpc --with-xsl --with-zlib --with-bz2 --with-mhash --with-zip --enable-fpm --enable-bcmath --enable-inline-optimization --enable-mbregex --enable-mbstring --enable-opcache --enable-pcntl --enable-shmop --enable-soap --enable-sockets --enable-sysvsem --enable-sysvshm --enable-xml --enable-fpm --disable-shared ONIG_CFLAGS=/root/php/depend/onig/include ONIG_LIBS=/root/php/depend/onig/lib LIBZIP_CFLAGS=/root/php/depend/libzip/include LIBZIP_LIBS=/root/php/depend/libzip/lib OPENSSL_CFLAGS=/root/php/depend/openssl/include OPENSSL_LIBS=/root/php/depend/openssl/lib KERBEROS_CFLAGS=/root/php/depend/krb5/include KERBEROS_LIBS=/root/php/depend/krb5/lib SQLITE_CFLAGS=/root/php/sqlite-amalgamation-3310100 SQLITE_LIBS=/root/php/sqlite-amalgamation-3310100 JPEG_CFLAGS=/root/php/depend/jpeg/include JPEG_LIBS=/root/php/depend/jpeg/lib PNG_CFLAGS=/root/php/depend/png/include PNG_LIBS=/root/php/depend/png/lib CFLAGS="-I/root/php/depend/openssl/include -I/root/php/depend/krb5/include -I/root/php/depend/onig/include -I/root/php/depend/jpeg/include -I/root/php/depend/libzip/include -I/root/php/sqlite-amalgamation-3310100 -I/root/php/depend/png/include" LIBS="-lsqlite3 -ljpeg -lzip -lonig -lpng -lssl -lcrypto"
make && make install
 

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