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=

相關文章
相關標籤/搜索