歡迎您光臨本站 註冊首頁

編譯php報錯

←手機掃碼閱讀     火星人 @ 2014-03-03 , reply:0

編譯php報錯

編譯php報錯
錯誤如下誰知道怎麼回事幫忙解決下

In file included from /usr/local/src/php-5.4.9/ext/gd/gd.c:103:
/usr/local/src/php-5.4.9/ext/gd/gd_ctx.c: In function ?.php_image_stream_putc?.
/usr/local/src/php-5.4.9/ext/gd/gd_ctx.c:51: error: ?.truct gdIOCtx?.has no member named ?.ata?
/usr/local/src/php-5.4.9/ext/gd/gd_ctx.c: In function ?.php_image_stream_putbuf?.
/usr/local/src/php-5.4.9/ext/gd/gd_ctx.c:58: error: ?.truct gdIOCtx?.has no member named ?.ata?
/usr/local/src/php-5.4.9/ext/gd/gd_ctx.c: In function ?.php_image_stream_ctxfree?.
/usr/local/src/php-5.4.9/ext/gd/gd_ctx.c:67: error: ?.truct gdIOCtx?.has no member named ?.ata?
/usr/local/src/php-5.4.9/ext/gd/gd_ctx.c:68: error: ?.truct gdIOCtx?.has no member named ?.ata?
/usr/local/src/php-5.4.9/ext/gd/gd_ctx.c:69: error: ?.truct gdIOCtx?.has no member named ?.ata?
/usr/local/src/php-5.4.9/ext/gd/gd_ctx.c: In function ?.php_image_output_ctx?.
/usr/local/src/php-5.4.9/ext/gd/gd_ctx.c:153: error: ?.dIOCtx?.has no member named ?.ata?
make: *** Error 1
《解決方案》

php 編譯

./configure --with-apxs2=/usr/local/apache/bin/apxs --disable-ipv6 --with-libxml-dir=/usr --with-openssl=/usr  --with-zlib=/usr --with-bz2=/usr --enable-calendar --with-curl=/usr  --with-pcre-dir=/usr/local --enable-ftp --with-openssl-dir=/usr --with-gd=/usr/local/gd2 --with-jpeg-dir=/usr  --with-xpm-dir=/usr --with-freetype-dir=/usr/local/freetype --enable-gd-native-ttf --enable-gd-jis-conv  --enable-mbstring --with-mcrypt=/usr/local  --with-snmp=/usr --enable-sockets --enable-zip --with-gettext --enable-bcmath

安裝PHP步驟: 1:安裝freetype,zlib,jpeg,libpng,libiconv,libxml2-2.6.25,Fontconfig
              2:安裝gd庫
              3:安裝php

1).安裝zlib

tar zlib-1.2.3.tar.gz
cd zlib-1.2.3
./configure --prefix=/usr/local/zlib
make
make install


2).安裝libpng

tar zxvf libpng-1.2.16.tar.tar
cd libpng-1.2.16
cd scripts/
mv makefile.linux ../makefile
cd ..
make
make install
注意,這裡的makefile不是用./configure生成,而是直接從scripts/里拷一個


3).安裝freetype

tar zxvf freetype-2.3.4 .tar.gz
cd freetype-2.3.4
./configure --prefix=/usr/local/freetype
make
make install


4).安裝Jpeg

tar -zxf jpegsrc-1.v6b.tar.gz
cd jpeg-6b/
mkdir /usr/local/libjpeg
mkdir /usr/local/libjpeg/include
mkdir /usr/local/libjpeg/bin
mkdir /usr/local/libjpeg/lib
mkdir /usr/local/libjpeg/man

mkdir /usr/local/libjpeg/man/man1

//可以用mkdir -p /usr/local/libjpeg/man/man1 一步創建多層目錄

./configure --prefix=/usr/local/libjpeg --enable-shared --enable-static
make && make install
注意,這裡configure一定要帶--enable-shared參數,不然,不會生成共享庫


5).安裝Fontconfig

tar -zxvf fontconfig-2.4.2.tar.gz
cd fontconfig-2.4.2

./configure

make
make install


6).安裝GD

tar -zxvf gd-2.0.34.tar.gz
cd gd-2.0.34
./configure --prefix=/usr/local/libgd --with-png --with-freetype=/usr/local/freetype --with-jpeg=/usr/local/libjpeg

make
make install

編譯時顯示以下信息:

** Configuration summary for gd 2.0.34:

Support for PNG library: yes
Support for JPEG library: yes
Support for Freetype 2.x library: yes
Support for Fontconfig library: yes
Support for Xpm library: no
Support for pthreads: yes


7).編輯/etc/ld.so.conf,添加以下幾行到此文件中。

/usr/local/zlib/lib

/usr/local/freetype/lib

/usr/local/libjpeg/lib

/usr/local/libgd/lib

並執行ldconfig命令,使用動態裝入器裝載找到共享庫


8).安裝libxml
# tar –zxvf libxml2-2.6.25.tar.gz
# cd libxml2-2.6.25
# ./configure
# make
# make install

[火星人 ] 編譯php報錯已經有277次圍觀

http://coctec.com/docs/service/show-post-412.html