您的位置:首页 > 其它

lamp环境编译出现的相关问题

2014-02-26 19:04 316 查看
1、php

编译、生成php都正常,在安装的时候出现下面错误:

错误如下:

error while loading shared libraries: libiconv.so.2: cannot open shared object file: No such file or directory

make[1]: *** [install-pear-installer] 错误 127

make: *** [install-pear] Error 2

============================================

google了下,试了很多方法都不行,find后,发现我的/usr/local/lib里面有库文件,但是/usr/lib里面没有。

于是用软链接:

ln -s /usr/local/lib/libiconv.so.2 /usr/lib/libiconv.so.2

之后 make clean

再编译 生成 安装,一切正常。

=================================================

另外出现libmysqlclient.so.15、libmysqlclient.so.16错误,同样可以去/usr/local/mysql/lib下面复制这两个文件到/usr/lib下面,或者直接设置软链接。。。

再make clean,重新编译安装即可。

原址有相关libmysqlclient.so.15、libmysqlclient.so.16、libiconv.so.2下载
====》

libltdl.so.3: cannot open shared object file: No
such file or directory异常

解决:执行[root@localhost ~]# ln -s /usr/local/lib/libltdl.so.3 /usr/lib/libltdl.so.3 即可


php5.4安装报错 ‘gdIOCtx’ 没有名为 ‘data’ 的成员

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

centos6.4编译安装php 5.4.X时,configure能正常通过,但是在make的时候提示:

In file included from /root/php-5.3.6/ext/gd/libgd/gd_compat.c:8:

/usr/local/jpeg/include/jpeglib.h:938: error: expected declaration specifiers or ‘...’ before ‘FILE’

/usr/local/jpeg/include/jpeglib.h:939: error: expected declaration specifiers or ‘...’ before ‘FILE’

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

修改php-5.4.9/ext/gd/libgd/gd_compat.c 把png.h 改成绝对路径(这个在编译gd库的时候应该就碰到了,同样的路径即可)

并在# include <jpeglib.h> 前面增加一行 #include <stdio.h>

修改后如下所示:

#include "php_config.h"

#ifdef H***E_GD_PNG

/* needs to be first */

# include </usr/local/libpng/include/png.h> //修改此处

#endif

#ifdef H***E_GD_JPG

#include <stdio.h> //修改此处

# include <jpeglib.h>

#endif

然后make clean

重新configure 、make 、make install 就可以了。

第二例:

configure能正常通过,make配置到最后报错:make: *** [ext/gd/gd.lo] Error 1



据说这个错误是php5.4的bug:

解决方法

vim /usr/local/gd2/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);



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



long (*tell) (struct gdIOCtx *);



void (*gd_free) (struct gdIOCtx *);

void (*data); //新增的内容

}

gdIOCtx;

==========================================================

重新编译前最好执行如下:

[root@localhost php-5.4.5]# make clean

重新configure 、make 、make install 就可以了。

这个错误算是php5.4的bug,下面对应的两篇文章有对应的说明:
https://bugs.php.net/bug.php?id=55224 https://bugs.php.net/bug.php?id=60108
php-5.5.10/ext/gd/gd.c:57:22: 错误:X11/xpm.h:没有那个文件或目录 make: *** [ext/gd/gd.lo] 错误 1

先 :yum install libXpm-devel在查询他的安装位置:

#rpm -ql libXpm-devel	/usr/bin/cxpm	/usr/bin/sxpm	/usr/include/X11/xpm.h	/usr/lib/libXpm.so	/usr/lib/pkgconfig/xpm.pc	/usr/share/man/man1/cxpm.1.gz	/usr/share/man/man1/sxpm.1.gz

在PHP的./configure配置中添加:--with-xpm-dir=/usr/lib配置
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐