1. 安装依赖 libpng、libzip、zlib、freetype、libgd、libjpeg
libpng
wget https://baitexiaoyuan.oss-cn-zhangjiakou.aliyuncs.com/updatecrm/php/20230714/libpng-1.6.31.tar.gz
tar -xzvf libpng-1.6.31.tar.gz
cd libpng-1.6.31
./configure --prefix=/usr/local/libpng --enable-shared
make
make install
libzip
wget https://baitexiaoyuan.oss-cn-zhangjiakou.aliyuncs.com/updatecrm/php/20230714/libzip-1.2.0.tar.gz
tar -zxvf libzip-1.2.0.tar.gz
cd libzip-1.2.0
./configure
make
make install
zlib
wget http://www.zlib.net/zlib-1.2.11.tar.gz
tar -xzvf zlib-1.2.11.tar.gz
cd zlib-1.2.11
./configure --prefix=/usr/local/zlib --enable-shared
make
make install
freetype
wget https://baitexiaoyuan.oss-cn-zhangjiakou.aliyuncs.com/updatecrm/php/20230714/freetype-2.10.1.tar.gz
tar -xzvf freetype-2.10.1.tar.gz
cd freetype-2.10.1
./configure --prefix=/usr/local/freetype --enable-shared
make
make install
libgd
wget https://baitexiaoyuan.oss-cn-zhangjiakou.aliyuncs.com/updatecrm/php/20230714/libgd-2.2.3.tar.gz
tar -xzvf libgd-2.2.3.tar.gz
cd libgd-2.2.3
./configure --enable-shared
make
make install
make clean
make distclean
libjpeg
wget https://baitexiaoyuan.oss-cn-zhangjiakou.aliyuncs.com/updatecrm/php/20230714/jpegsrc.v9d.tar.gz
tar -xzvf jpegsrc.v9d.tar.gz
cd jpeg-9d
./configure --prefix=/usr/local/libjpeg --enable-shared
make
make install
2. 进入PHP目录安装扩展
cd ~/php-7.4.19/
ll
cd ext/
cd gd/
ll
/usr/local/php74/bin/phpize
./configure ---enable-gd --with-php-config=/usr/local/php74/bin/php-config --with-jpeg=/usr/local/libjpeg --with-freetype=/usr/local/freetype make
make install
发表评论 取消回复