Docker為PHP安裝gd擴展


安裝擴展庫的通常命令

docker-php-ext-install 擴展庫名

安裝gd庫需要特殊照顧,步驟如下

//進入PHP容器
//更新軟件源
apt update
//安裝各種庫
apt install -y libwebp-dev libjpeg-dev libpng-dev libfreetype6-dev
//解壓源碼
docker-php-source extract
//進入gd源碼文件夾
cd /usr/src/php/ext/gd 
//准備編譯
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 
//查看是否成功安裝gd擴展
php -m | grep gd
//重啟容器


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM