阿里云 centos php 让 GD库支持libjpeg

今天用到图片处理生成缩略图的功能,上传到服务器提示

Fatal error: Call to undefined function imagecreatefromjpeg() 

服务器上装了GD库但是不支持jpg,查看了phpinfo信息

网上找了一些方法,先装相关的jpeg库装完结果出现新的错误

 

最终解决方法:重新编译安装php  添加  --with-jpeg-dir 即可不用加  --with-jpeg-dir=/usr/local/jpeg 这样的参数,不然又出错

GD build test failed. Please check the config.log for details.去掉重新config  make && make install 再次查看phpinfo

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章