• 转 安装php时报gd相关的错误(gd_ctx.c)


    在安装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;

  • 相关阅读:
    hmac
    struct模块-黏包的解决方法
    PHPCMS快速建站系列
    Notepad++搜索中的正则应用
    用var 变量=函数名 方式调用函数时如何传值的问题
    ThInkPHP中的常量
    css cursor 的可选值(鼠标的各种样式)
    JS实现用键盘控制DIV上下左右+放大缩小与变色
    PHP定义数组常量
    FormData实现文件上传实例
  • 原文地址:https://www.cnblogs.com/xiangxiaodong/p/3492990.html
Copyright © 2020-2023  润新知