LAMP 源代码包安装异常记录(64位)

###安装JPG6###php

安装jpg-6b 时,编译出错:mysql

make: ./libtool: Command not foundsql

make: *** [jcapimin.lo] Error 127shell

缘由是libtool版本太低了. 查看下libtool安装的版本 <!--lang:shell--> rpm -qa | grep libtool*api

去网上下一个新点的libtool, 我用的是 libtool-2.4.2.tar.gzui

<!--lang:shell-->
./configure
make && make install

而后进入jpeg-6b的源码目录,而后执行如下步骤,切记! <!--lang:shell--> cp /usr/share/libtool/config/config.sub . cp /usr/share/libtool/config/config.guess . ./configure --prefix=/usr/local/jpeg6/ --enable-shared --enable-static make mkdir -p /usr/local/man/man1 make install.net

###安装GD2 错误###debug

make2: *** [gd_png.lo] 错误 1 make2: Leaving directory /usr/src/gd-2.0.35' make[1]: *** [all-recursive] 错误 1 make[1]: Leaving directory /usr/src/gd-2.0.35' make: *** [all] 错误 2code

这是因为文件的自己有错误.ci

修改以下: <!--lang:shell--> vi gd_png.c #ifdef HAVE_CONFIG_H #include "config.h" #endif

#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>
#include "gd.h"

#ifdef HAVE_LIBPNG

#include "gdhelpers.h"
#修改下面:
#include "/usr/local/libpng/include/png.h"             

#define TRUE 1
#define FALSE 0"

#ifdef HAVE_LIBPNG

###安装APACHE###

在编译APACHE 时 会报相似下面的错误:

/usr/bin/ld: /usr/local/lib/libz.a(crc32.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC /usr/local/lib/libz.a: could not read symbols: Bad value

这也是64位兼容形成的. 解决方法以下:

进入zlib 源码目录 <!--lang:shell--> cd zlib-1.2.3 CFLAGS="-O3 -fPIC" ./configure //使用64位元的方法进行编译 make && make install

###安装ncurses###

报错以下:

tic: symbol lookup error: tic: undefined symbol: _nc_check_termtype2 ? tic could not build /usr/share/terminfo make1: *** [install.data] Error 1 make1: Leaving directory `/lamp/ncurses-5.6/misc' make: *** [install] Error 2

这是因为当前的ncurses版本太低,下在个新版的 ncurses-5.9.tar.gz 再按以前的编译安装就能够了

###安装PHP###

我安装的PHP 版本是5.4,听说安装时有个BUG,报错以下:

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

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

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

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

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

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

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

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

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

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

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

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

解决办法以下: 先进入安装PHP 的时候 关联 gd2 目录的地方 编辑里面的include/gd_io.h 在gdIOCtx结构中增长void *data;

<!--lang:shell-->
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;

###安装PDO###

安装PDO的时候会报这样的错误:

PDO_MYSQL-1.0.2/php_pdo_mysql_int.h:53: error: expected specifier-qualifier-list before ‘MYSQL_RES’ ...... make: *** [pdo_mysql.lo] Error 1

这是由于在编译时须要mysql的头的文件,而它按默认搜索找不到头文件的位置,因此才出现这个问题.因此要将 /usr/local/mysql/include/ 目录下的mysql头文件连接到 /usr/local/include/ 的目录下: <!--lang:shell--> ln -s {mysql安装文件路径}/include/mysql/* /usr/local/include/

###安装ZEND加速器### PHP5.3以上的版本再也不支持Zend Optimizer,已经被全新的 Zend Guard Loader 取代 去官网下载合适的版本

将下载的包解压,把里面的.so文件 拷到PHP的扩展目录里 个人是/usr/local/php/lib/php/extensions/no-debug-non-zts-20100525 而后修改php.ini <!--lang:shell--> zend_extension=/usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/ZendGuardLoader.so zend_loader.enable=1 zend_loader.disable_licensing=0 zend_loader.obfuscation_level_support=3 zend_loader.license_path=

相关文章
相关标签/搜索