php容器下安装gd库

本文档介绍了如何在基于arm64v8/php:7.4.14-fpm的环境中,在Docker PHP容器内配置和安装GD库。参考了相关文章,提供了使用`docker-php-ext-configure`和`--help`选项进行配置的指导。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

参考文章:https://blog.youkuaiyun.com/bbwangj/article/details/81474915

当前环境:arm64v8/php:7.4.14-fpm

进入php容器执行以下步骤

# 安装所需依赖
root@80d3844c2bb7:/var/www/html# apt-get install -y \
         libfreetype6-dev \
         libjpeg62-turbo-dev \
         libmcrypt-dev \
         libpng-dev 


# 查看freetype2库目录
root@80d3844c2bb7:/var/www/html# ls /usr/include/freetype2/
freetype  ft2build.h

# 配置gd库编译项
root@80d3844c2bb7:/var/www/html# docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/

# 安装gd库
root@80d3844c2bb7:/var/www/html# docker-php-ext-install gd

# 使用gd库扩展
root@80d3844c2bb7:/var/www/html# docker-php-ext-enable gd

docker-php-ext-configure --help

root@80d3844c2bb7:/var/www/html# docker-php-ext-configure --help
usage: /usr/local/bin/docker-php-ext-configure ext-name [configure flags]
   ie: /usr/local/bin/docker-php-ext-configure gd --with-jpeg-dir=/usr/local/something

Possible values for ext-name:
bcmath bz2 calendar ctype curl dba dom enchant exif ffi fileinfo filter ftp gd gettext gmp hash iconv imap intl json ldap mbstring mysqli oci8 odbc opcache pcntl pdo pdo_dblib pdo_firebird pdo_mysql pdo_oci pdo_odbc pdo_pgsql pdo_sqlite pgsql phar posix pspell readline reflection session shmop simplexml snmp soap sockets sodium spl standard sysvmsg sysvsem sysvshm tidy tokenizer xml xmlreader xmlrpc xmlwriter xsl zend_test zip

Some of the above modules are already compiled into PHP; please check
the output of "php -i" to see which modules are already loaded.

docker-php-ext-configure gd --help

root@80d3844c2bb7:/var/www/html# docker-php-ext-configure gd --help
Configuring for:
PHP Api Version:         20190902
Zend Module Api No:      20190902
Zend Extension Api No:   320190902
`configure' configures this package to adapt to many 
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值