[转] PHP7.4安装gd库的报错error: --with-freetype-dir --with-jpeg-dir

  • 服务器
  • 2022-03-23
  • 1383 已阅读
  • 作者: Phper_Bob
  • 来源: CSDN
       
简介在Linux给PHP7.4安装gd库的时候,会报错error: --with-freetype-dir --with-jpeg-dir等等,

在Linux给PHP7.4安装gd库的时候,会报错error: --with-freetype-dir --with-jpeg-dir等等,

就算能安装过去,php -m有了gd扩展,实际网页中图片也不能使用imagecreatefromjpeg,

百度到的安装命令都是./configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/类似的,

仔细查看PHP7.4的手册Other Changes才发现with参数改了

重新执行命令./configure gd --with-webp=/usr/include/webp --with-jpeg=/usr/include --with-freetype=/usr/include/freetype2/

安装成功,图片操作正常!

 

很赞哦! ( 1 )