安装php时,make步骤报错make: *** [ext/gd/gd.lo] Error 1
2015-08-26 15:07
381 查看
安装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
已经成功编译安装。
/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
已经成功编译安装。
相关文章推荐
- 运行phpize时出现:Cannot find autoconf. Please check your autoconf installation
- 加速器eaccelerator不兼容高版本php
- PHP中$_SERVER的详细参数与说明
- PHP函数遍历一个文件夹下的所有文件和子文件夹
- Windows2008 R2配置FTP教程
- yii2 改变首页,变成登录页
- yii2 去掉index.php的方法
- PHP5新语法学习
- php文件上传功能
- PHP抓取远程图片到本地
- php 面向对象之反射
- 安卓之FTP一些实战经验(异常处理,原理等)
- PHP查询数据库中满足条件的记录条数(二种实现方法)
- PHP的内存释放问题
- PHP分页类代码
- 关于使用matplotlib-legend方法失效问题
- ThinkPHP 解析访问路径的坑
- PHP数组排序
- php5中的对象比较
- Yii2 ArrayHelper