docker php7.4 No JPEG support in this PHP build
2022 May 01 技術筆記
用 docker 裝了 php7.4 的 image 後
使用 gd 操作 jpeg 的時候會產生
No JPEG support in this PHP build()
之類的錯誤
解法
在 docker 裡面跑
docker-php-ext-configure gd --with-freetype --with-jpeg --enable-gd
docker-php-ext-install gd
就可以了
或是如果是自己做的 dockerfile 的話
加入
RUN docker-php-ext-configure gd --with-freetype --with-jpeg --enable-gd
RUN docker-php-ext-install gd
這樣做好的 docker image 就會自動包好 有 jpeg 的 gd 了
ABOUT ME

路老闆 Louis
路老闆有限公司創辦人、Compassio 個人品牌一站式網站系統的開發者。二十年網站與行銷實戰經驗,長期陪伴講師、顧問與創作者把專業變成品牌。每週透過電子報與 Podcast《路老闆的個人品牌診療室》,分享個人品牌、網站經營與 AI 行銷的實務觀察。
如想留言評分,請先 登入會員!