安装扩展支持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. CentOS7 安装 Docker、最佳Docker学习文档

    目录 一.Docker支持 二.安装Docker -1.在新主机上首次安装Docker CE之前,需要设置Docker存储库.之后,就可以从存储库安装和更新Docker. 0.卸载旧版 1.正式安装 ...

  2. Hive学习笔记(一)——概述

    1.Hive是个什么玩意? Hive:由Facebook开源用于解决海量结构化日志的数据统计. Hive是基于Hadoop的一个数据仓库工具,可以将结构化的数据(有规律的数据)文件映射为一张表,并提供 ...

  3. Hive学习笔记(三)—— 数据类型

    Hive的基本使用(一)--数据类型 1. Hive的基本数据类型 Hive数据类型 Java数据类型 长度 例子 TINYINT byte 1byte有符号整数 20 SMALINT short 2 ...

  4. java Unicode和UTF-8之间转换

    utf-8转unicode public static String utf8ToUnicode(String inStr) { char[] myBuffer = inStr.toCharArray ...

  5. 阿里巴巴 Java 开发手册 (七) 控制语句

    1. [强制]在一个 switch 块内,每个 case 要么通过 break/return 等来终止,要么注释说明程 序将继续执行到哪一个 case 为止:在一个 switch 块内,都必须包含一个 ...

  6. Docker/Dockerfile debug调试技巧

    『重用』容器名 但我们在编写/调试Dockerfile的时候我们经常会重复之前的command,比如这种docker run --name jstorm-zookeeper zookeeper:3.4 ...

  7. pandas-10 pd.pivot_table()透视表功能

    pandas-10 pd.pivot_table()透视表功能 和excel一样,pandas也有一个透视表的功能,具体demo如下: import numpy as np import pandas ...

  8. 一道经典面试题,atoi函数的实现

    参考资料 (1)atoi函数的实现 (2)<剑指offer> 题目分析 本题需要注意的有几个方面: (1)检查输入参数,指针是否为NULL: (2)去除字符串前面的空格 (3)处理正负符号 ...

  9. php框架路由美化后提示No input file specified

    此问题出现在.htaccess上 Apache按如下代码修改即可: RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond % ...

  10. MySQL:查询、修改(二)

    干货: 使用SELECT查询的基本语句SELECT * FROM <表名>可以查询一个表的所有行和所有列的数据.SELECT查询的结果是一个二维表. 使用SELECT *表示查询表的所有列 ...