在安装php时,报如下错误

In file included from /kk/php-5.4.0/ext/gd/gd.c:103:

/kk/php-5.4.0/ext/gd/gd_ctx.c: In function ‘_php_image_stream_putc’:

/kk/php-5.4.0/ext/gd/gd_ctx.c:51: 错误:‘struct gdIOCtx’ 没有名为 ‘data’ 的成员

/kk/php-5.4.0/ext/gd/gd_ctx.c: In function ‘_php_image_stream_putbuf’:

/kk/php-5.4.0/ext/gd/gd_ctx.c:58: 错误:‘struct gdIOCtx’ 没有名为 ‘data’ 的成员

/kk/php-5.4.0/ext/gd/gd_ctx.c: In function ‘_php_image_stream_ctxfree’:

/kk/php-5.4.0/ext/gd/gd_ctx.c:67: 错误:‘struct gdIOCtx’ 没有名为 ‘data’ 的成员

/kk/php-5.4.0/ext/gd/gd_ctx.c:68: 错误:‘struct gdIOCtx’ 没有名为 ‘data’ 的成员

/kk/php-5.4.0/ext/gd/gd_ctx.c:69: 错误:‘struct gdIOCtx’ 没有名为 ‘data’ 的成员

/kk/php-5.4.0/ext/gd/gd_ctx.c: In function ‘_php_image_output_ctx’:

/kk/php-5.4.0/ext/gd/gd_ctx.c:153: 错误:‘gdIOCtx’ 没有名为 ‘data’ 的成员

make: *** [ext/gd/gd.lo] 错误 1

好像说这个错误算是php5.4的bug,下面对应的两篇文章有对应的说明:
https://bugs.php.net/bug.php?id=55224
https://bugs.php.net/bug.php?id=60108

解决方法

vi <gd_dir>/include/gd_io.h

gdIOCtx结构中增加void *data;

格式如下

typedef struct gdIOCtx

{

int (*getC) (struct gdIOCtx *);

int (*getBuf) (struct gdIOCtx *, void *, int);

void (*putC) (struct gdIOCtx *, int);

int (*putBuf) (struct gdIOCtx *, const void *, int);

/* seek must return 1 on SUCCESS, 0 on FAILURE. Unlike fseek! */

int (*seek) (struct gdIOCtx *, const int);

long (*tell) (struct gdIOCtx *);

void (*gd_free) (struct gdIOCtx *);

void (*data);

}

gdIOCtx;

转 安装php时报gd相关的错误(gd_ctx.c)的更多相关文章

  1. 安装 gcc-c++ 时报错和原有 gcc 版本冲突

    Centos 6.7 安装 gcc-c++时报下面的错误: Resolving Dependencies --> Running transaction check ---> :-.el6 ...

  2. ubuntu:通过封装验证码类库一步步安装php的gd扩展

    我相信很多人的lamp环境都是直接复制一堆参数安装进去的,这里有可能成功,也有可能失败,如果是新手,估计要碰到各种错误,就算安装成功,也未必知道那些参数是干嘛的,反正装进去能用就行. 我当初开始的时候 ...

  3. 1.Maven+SpringMVC+Eclipse软件安装配置,Maven报插件错误,Eclipse总是卡死的解决办法,导入一个maven工程后 一直显示importing maven project

     使用Maven+SpringMVC+Eclipse软件安装配置过程中的问题: 1.Eclipse总是卡死的解决办法: 一:内存不足所以会卡死,配置一下eclipse.ini修改这几个值就好了-X ...

  4. 【安装Python环境】之安装Selenium2时报UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc8 in position 12: invalid continuation byte问题

    问题描述: windows8.1系统,Python3环境安装Selenium2时报错,错误如下: ..... ..... File "F:\软件\python3.6.1\lib\site-p ...

  5. Python安装setuptools时报Compression requires the (missing) zlib

    装机员为您提供Python安装setuptools时报Compression requires the (missing) zlib的文章咨询供您阅读,如何使用Python安装setuptools时报 ...

  6. Linux下安装PHP的GD支持库

    Linux下安装PHP的GD支持库   1.安装 zlib  wget ftp://ftp.sunfreeware.com/pub/freeware/SOURCES/zlib-1.2.3.tar.gz ...

  7. 关于Linux下安装Oracle时报错:out of memory的问题分析说明

    一.说明 在Oracle安装过程中,可能遇到out of memory这种错误,这是由于系统内存不足导致!我们可以通过加内存的方式解决! 而如果是另一种情况呢: 例如我在主机上装了两个Oracle服务 ...

  8. 安装mysql会出现start service错误

    安装MySQL时无法启动服务(could not start the service MYSQL .Error:0)安装mysql会出现start service错误安装mysql时 配置到start ...

  9. 在安装pdfplumber时报错 Microsoft Visual C++ 14.0 is required.

    在安装pdfplumber时报下列错误: 解决方法:     更新pip ,因为pip 版本太旧 来自为知笔记(Wiz)

随机推荐

  1. [转]缓慢但胜在稳健,HBase大势已成

    CSDN Hbase : http://www.csdn.net/tag/hbase 在NoSQL数据库领域,统治产品无疑当属MongDB和DataStax Enterprise(一个领先的Apach ...

  2. B. Random Teams(Codeforces Round 273)

    B. Random Teams time limit per test 1 second memory limit per test 256 megabytes input standard inpu ...

  3. [转]应用RSACryptoServiceProvider类轻松实现RSA算法

    在我们现实当中经常会存在需要对某些数据进行加密保护 然后进行解密的操作,比方,我们需要对某些XML配置信息里面的某些数据进行加密,以防止任何人打开该XML配置信息都能正常的看到该配置信息里面的内容,从 ...

  4. Linux awk 命令

    AWK是一种处理文本文件的语言,是一个强大的文本分析工具. 之所以叫AWK是因为其取了三位创始人 Alfred Aho,Peter Weinberger, 和 Brian Kernighan 的Fam ...

  5. go语音之进阶篇爬百度贴吧单线程版本

    一.爬什么? 1.明确目标 : 知道你准备在那个范围或者网站去搜索 2.爬: 将所有的网站的内容全部爬下来 3.取:去掉对我们没用处的数据 4.处理数据:按照我们想要的方式存储或使用 二.百度贴吧小爬 ...

  6. [leetcode]Spiral Matrix @ Python

    原题地址:https://oj.leetcode.com/problems/spiral-matrix/ 题意: Given a matrix of m x n elements (m rows, n ...

  7. [leetcode]Best Time to Buy and Sell Stock II @ Python

    原题地址:https://oj.leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/ 题意: Say you have an array ...

  8. [leetcode]Median of Two Sorted Arrays @ Python

    原题地址:https://oj.leetcode.com/problems/median-of-two-sorted-arrays/ 题意:There are two sorted arrays A ...

  9. 老猪带你玩转自定义控件三——sai大神带我实现ios 8 时间滚轮控件

    ios 8 的时间滚轮控件实现了扁平化,带来很好用户体验,android没有现成控件,小弟不才,数学与算法知识不过关,顾十分苦恼,幸好在github上找到sai大神实现代码,甚为欣喜,顾把学习这个控件 ...

  10. CSS命名规范和规则

    一.命名规则 ).尽量不缩写,除非一看就明白的单词 二.class的命名 (1).red { color: red; } .f60 {color: #f60; } .ff8600{ color: #f ...