安装扩展支持jpeg格式:

第一步:首先下载文件:
版本v8:
wget http://www.ijg.org/files/jpegsrc.v8b.tar.gz
版本v9:
wget http://www.ijg.org/files/jpegsrc.v9c.tar.gz 把jpeg安装到home目录:

./configure --prefix=/home/jpeg --enable-shared --enable-static
make && make install 第二步:安装到配置文件中
、找到php 源码目录
cd /home/ubuntu/downphp/php-7.0. 、进入 ext/gd 目录
cd /home/ubuntu/downphp/php-7.0./ext/gd 、执行命令:/home/php/bin/phpize
[root@daokr gd]#/home/php/bin/phpize
Configuring for:
PHP Api Version:
Zend Module Api No:
Zend Extension Api No: 、注意 with-freetype-dir 路径必须加载否则报错
./configure --with-php-config=/home/php/bin/php-config --with-jpeg-dir=/home/jpeg --with-freetype-dir=/usr/local/include/freetype2 、make && make install
、重启 httpd 如果上面的步骤解决不了那就重新安装php吧: 记得把
--with-jpeg-dir=/home/jpeg 加上

重新安装phpconfig

./configure --prefix=/home/php --with-config-file-path=/home/php/etc --with-fpm-user=ubuntu --with-fpm-group=ubuntu --with-pdo-mysql --with-openssl --with-pear --with-mhash --with-xmlrpc --with-zlib --with-mcrypt --with-curl --with-jpeg-dir=/home/jpeg --with-gd --with-freetype-dir=/usr/local/include/freetype2 --without-sqlite3 --without-pdo-sqlite --disable-rpath --without-pear --enable-fpm --enable-maintainer-zts --enable-pcntl --with-tsrm-pthreads --enable-mbstring --enable-mbregex --enable-bcmath --enable-zip --enable-sockets --enable-soap --enable-gd-native-ttf --enable-xml --enable-inline-optimization --enable-mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd

liconv close 错误解决:vim MakeFile

EXTRA_LIBS = -lcrypt -lz -lresolv -lcrypt -lmcrypt -lltdl -lpng -lz -ljpeg -lcurl -lz -lrt -lm -ldl -lnsl -lxml2 -lssl -lcrypto -lcurl -lxml2 -lssl -lcrypto -lfreetype -lxml2 -lxml2 -lcrypt -lxml2 -lxml2 -lxml2 -lxml2 -lssl -lcrypto -lcrypt -liconv

这个版本不能用imagecreatefromjpeg:

Warning: imagecreatefromjpeg(): gd-jpeg: JPEG library reports unrecoverable

为啥呢;百度了半天没解决最后还是重新编译php安装了。

最终还是重新编译了PHP配置

 ./configure --prefix=/home/php --with-config-file-path=/home/php/etc --with-fpm-user=ubuntu --with-fpm-group=ubuntu --with-pdo-mysql --with-openssl --with-pear --with-mhash --with-xmlrpc --with-zlib --with-mcrypt --with-curl --with-jpeg-dir --with-png-dir --with-gd --with-freetype-dir=/usr/local/include/freetype2 --without-sqlite3 --without-pdo-sqlite --disable-rpath --without-pear --enable-fpm --enable-maintainer-zts --enable-pcntl --with-tsrm-pthreads --enable-mbstring --enable-mbregex --enable-bcmath --enable-zip --enable-sockets --enable-soap --enable-gd-native-ttf --enable-xml --enable-inline-optimization --enable-mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --enable-ftp --with-gettext --enable-opcache

$f = 'uploads/face/010/00/00/2296f8b53a3324e528ff37cba61cb14f_240_240.jpg';
var_dump(getImageSize($f));
$a = imagecreatefromjpeg($f);
var_dump($a);die;

成功输出:

Call to undefined function imagecreatefromjpeg() 让GD支持JPEG格式的图片扩展的更多相关文章

  1. 一般源码安装添加的GD库 是不支持 jpeg 格式的图片的

    一般源码安装添加的GD库 是不支持 jpeg 格式的图片的,只支持如下格式 GD Support enabled GD Version bundled (2.0.34 compatible) GIF ...

  2. 火狐不支持webp格式的图片

    <!DOCTYPE html> <html lang="en"> <style> ul{list-style: none;} li{float: ...

  3. 超图不支持JPEG格式的WMTS服务

    就目前面而言,超图不支持JPEG格式的WMTS服务,只支持PNG格式的. <本篇完>

  4. Linux下php+imagemagick支持webp格式的图片

    摘要 ImageMagick是一款功能强大的图片处理工具包,很多互联网应用中都会涉及到图片处理工作,比如切割.缩放.水印.格式转换等.ImageMagick就是一个理想的工具包. 安装基础依赖 先检查 ...

  5. gd库不支持jpeg的解决方法

    杜工就不在这里啰嗦怎么遇到这个问题的了,如果你确实安装了的gd库,却发现无法支持jpeg格式的图片,可从下面找到答案. 原因是在编译gd库前,配置时未声明jpeg库路径.解决方法如下: 32位系统: ...

  6. 在已经编译安装好php7场景下,install gd库 with free-type (解决Call to undefined function imagettftext())

    在已经编译安装好php7场景下,install gd库 with free-type (解决Call to undefined function   imagettftext()) install g ...

  7. php重新编译,gd扩展支持jpeg文件

    晚上写东西的时候,报了一个错误: Call to undefined function imagecreatefromjpeg() 没有开启 jpeg 支持?原来是默认安装的 gd 扩展默认不支持 j ...

  8. php命令行运行出现错误Call to undefined function curl_init()

    在windows命令行窗口下运行php命令,需要将php.exe所在的路径添加到Path环境变量,例如C:\wamp\bin\php\php5.4.3 启动Apache服务 在命令行中输入php te ...

  9. Call to undefined function think\finfo_open() 报错 解决方法

    Call to undefined function think\finfo_open() 经过各方面排查,是fileinfo扩展没有安装 安装即可

随机推荐

  1. python 函数的链式调用(一个函数调用使用两个括号)

    # python 函数的链式调用 def funcA(a): def funcB(b): for a_each in a: x = funcB(a_each) return x return func ...

  2. Apple SIP简介及在Clover中如何控制

    Apple SIP简介及在Clover中如何控制 来源 http://www.yekki.me/apple-sip-overview-and-how-to-disable-it-in-clover/ ...

  3. 如何让 height:100%; 起作用---父级元素必须设定高度

    参考: http://www.webhek.com/post/css-100-percent-height.html https://www.cnblogs.com/kunmomo/p/1060066 ...

  4. Java自学-控制流程 for

    Java的for循环 for循环,和while一样,只是表达方式不一样 示例 1 : for 比较for和while public class HelloWorld { public static v ...

  5. Python进阶(八)----模块,import , from import 和 `__name__`的使用

    Python进阶(八)----模块,import , from import 和 __name__的使用 一丶模块的初识 #### 什么是模块: # 模块就是一个py文件(这个模块存放很多相似的功能, ...

  6. MySQL数据库汇总

    -- mysql的最大连接数:默认为 100   -- mysql的增删改查   -- mysql统计各个字段(case when 用法 注:也可以使用其他的)   select (case when ...

  7. Vue项目开发相关问题总结

    Vue项目开发相关问题总结 一.创建一个项目(两种方式) 1.通过CLI命令行创建,具体步骤如下: (1)Node 版本要求 Vue CLI 需要 Node.js 8.9 或更高版本 (推荐 8.11 ...

  8. js 数据类型检测

    提起数据类型检测  大多数人首先想起的应该是  typeof 'xxx' == '数据类型' 坦然这种方法对于基本数据类型的检测还是非常方便的,但是当遇到引用数据类型 Object时却爱莫能助,下面就 ...

  9. vue中常见的指令

    1,差值表达式{{}} <p >{{ msg }}</p> 2.v-cloak解决差值表达式闪烁的问题 <p v-cloak>{{ msg }}</p> ...

  10. 原油petrolaeum石油 Archaic spelling of petroleum

    petrolaeum (uncountable) Archaic spelling of petroleum petroleum See also: Petroleum Contents [hide] ...