安装依赖库
apt install -y libwebp-dev libjpeg-dev libpng-dev libfreetype6-dev
如果安装时较慢,请更换国内源
解压源码
docker-php-source extract
配置编译环境
docker-php-ext-configure gd --with-webp-dir=/usr/include/webp --with-jpeg-dir=/usr/include --with-png-dir=/usr/include --with-freetype-dir=/usr/include/freetype2
编译安装
docker-php-ext-install gd
查看结果
php -m | grep gd
网友评论