make: php_mysql.lo error 1_安装php时,make步骤报错make: *** [ext/gd/gd.lo] Error 1

在安装PHP 5.4.0时遇到GD库编译错误,错误涉及GD_CTX结构体成员未定义。尝试不指定GD路径进行配置,但随后出现新的错误:`could not read symbols: Bad value`。为解决这个问题,针对64位系统,使用特定的CFLAGS重新编译安装ZLIB,然后重新编译PHP,最终成功完成PHP的编译安装。
摘要由CSDN通过智能技术生成

安装PHP时,make步骤报错make: *** [ext/gd/gd.lo] Error 1

/usr/local/src/LAMP+memcahed+catci/php-5.4.0/ext/gd/gd_ctx.c: In function '_php_image_stream_putc':

/usr/local/src/LAMP+memcahed+catci/php-5.4.0/ext/gd/gd_ctx.c:51: error: 'struct gdIOCtx' has no member named 'data'

/usr/local/src/LAMP+memcahed+catci/php-5.4.0/ext/gd/gd_ctx.c: In function '_php_image_stream_putbuf':

/usr/local/src/LAMP+memcahed+catci/php-5.4.0/ext/gd/gd_ctx.c:58: error: 'struct gdIOCtx' has no member named 'data'

/usr/local/src/LAMP+memcahed+catci/php-5.4.0/ext/gd/gd_ctx.c: In function '_php_image_stream_ctxfree':

/usr/local/src/LAMP+memcahed+catci/php-5.4.0/ext/gd/gd_ctx.c:67: error: 'struct gdIOCtx' has no member named 'data'

/usr/local/src/LAMP+memcahed+catci/php-5.4.0/ext/gd/gd_ctx.c:68: error: 'struct gdIOCtx' has no member named 'data'

/usr/local/src/LAMP+memcahed+catci/php-5.4.0/ext/gd/gd_ctx.c:69: error: 'struct gdIOCtx' has no member named 'data'

In file included from /usr/local/src/LAMP+memcahed+catci/php-5.4.0/ext/gd/gd.c:103:

/usr/local/src/LAMP+memcahed+catci/php-5.4.0/ext/gd/gd_ctx.c: In function '_php_image_output_ctx':

/usr/local/src/LAMP+memcahed+catci/php-5.4.0/ext/gd/gd_ctx.c:153: error: 'gdIOCtx' has no member named 'data'

make: *** [ext/gd/gd.lo] Error 1

这个问题好像是处在GD上,先试着不指定GD的路径

./configure --prefix=/usr/php \

--with-gd --with-apxs2=/usr/apache/bin/apxs \

--enable-mbregex --enable-bcmath \

--with-mysql=/usr/mysql --with-zlib-dir=/usr/zlib \

--enable-mbstring=all --with-pdo-mysql \

--with-mysql-sock=/var/mysql --with-freetype-dir=/usr/freetype

make

这下虽然没有上边那个错误,但是新的错误又来了。

could not read symbols: Bad value

经网上一查,如果系统是64位,需要用64位元的方法重新编译安装zlib:

[root@serv-169 usr]# CFLAGS="-O3 -fPIC" ./configure --prefix=/usr/zlib

[root@serv-169 usr]# make

[root@serv-169 usr]# make install

[root@serv-169 usr]# make clean

现在在来编译php试试

make

make install

已经成功编译安装。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值