freetype 基于 gd ,所以只需要重新编译gd.so即可
1、编译安装freetype
# wget https://download.savannah.gnu.org/releases/freetype/freetype-2.10.2.tar.gz # tar -xvf freetype-2.10.2.tar.gz # cd /var/www/html/freetype-2.10.2 # mkdir -p /usr/local/freetype # apk add --no-cache musl-dev make gcc libxml2-dev openssl-dev sqlite sqlite-dev curl-dev libedit-dev libsodium-dev argon2 argon2-dev # ./configure --prefix=/usr/local/freetype # make -j 10 && make install
2、 编译 jpegsrc
# cd /var/www/html # wget http://www.ijg.org/files/jpegsrc.v9.tar.gz # tar -xvf jpegsrc.v9.tar.gz # cd /var/www/html/jpeg-9 # mkdir -p /usr/local/jpeg # ./configure --prefix=/usr/local/jpeg # make -j 10 && make install
3、编译 libpng
# cd /var/www/html # wget https://sourceforge.net/projects/libpng/files/libpng16/1.6.37/libpng-1.6.37.tar.gz # tar -xvf libpng-1.6.37.tar.gz # cd /var/www/html/libpng-1.6.37 # mkdir -p /usr/local/libpng # ./configure --prefix=/usr/local/libpng # make -j 10 && make install
4、 编译安装gd
# cd /usr/src/ && tar -xvf php.tar.xz # apk add autoconf freetype freetype-dev # cd /usr/src/php-7.3.11/ext/gd # /usr/local/bin/phpize # ./configure --with-freetype-dir=/usr/local/freetype --with-png-dir=/usr/local/libpng --with-jpeg-dir=/usr/local/jpeg # make -j 10 && make install
# 清除无用文件
rm -rf /var/www/html/* /usr/src/php-7.3.11/