Re-compile php4 under Linux

參考:
http://www.php5.idv.tw/blog/weisily/modules.php?act=article&do=show&id=22

為了讓 php4 具有圖形及編碼等擴充能力,需要外部的函示庫,如 libiconv, libjpeg, libpng …等,所以必須重新編譯 php4。


Compile libiconv from source:
cd /usr/local/src
tar -zxvf libiconv-1.9.3.tar.gz
cd libiconv-1.9.2
./configure –prefix=/usr/local
make
make install

Compile libjpeg from source:
cd /usr/local/src
tar -zxvf jpegsrc.v6b.tar.gz
cd jpeg-6b
./configure –prefix=/usr/local
make
make install
make install-lib

Compile libpng from source:
cd /usr/local/src
tar -zxvf libpng-1.2.8.tar.gz
cd libpng-1.2.8
cp scripts/makefile.linux makefile
make
make install

Compile cpdflib from source:
cd /usr/local/src
tar -zxvf clibpdf202r1.tar.gz
cd ClibPDF/source
cp Makefile.Linux makefile
make
make install

Compile curl from source:
cd /usr/local/src
tar -zxvf curl-7.12.1.tar.gz
cd curl-7.12.1
./configure –prefix=/usr/local
make
make install

Compile freetype 2 from source:
cd /usr/local/src
tar -jxvf freetype-2.1.9.tar.bz2
cd freetype-2.1.9
./configure –prefix=/usr/local
make
make install

當編譯好上述的函示庫後,即可重新編譯 php。
Compile PHP(底下指令為連續的一行):

  • ./configure –prefix=/usr/local/php4 –with-apxs2=/usr/local/apache2/bin/apxs –with-mysql=/usr –with-mysqli=/usr/bin/mysql_config –with-mysql-sock=/var/lib/mysql/mysql.sock –with-sqlite –enable-sqlite-utf8 –with-zlib –with-zlib-dir –with-bz2 –with-gd –enable-gd –enable-gd-native-ttf –with-jpeg-dir=/usr/local –with-png-dir=/usr/local –with-ttf –with-freetype-dir=/usr/local –with-iconv=/usr/local –with-curl=/usr/local –with-gettext –with-config-file-path=/usr/local/apache2/conf –enable-ftp –with-cpdflib=/usr/local –enable-mbstring
  • make
  • make install

文章導覽

   

共有 4 則迴響

  1. hi Jeff:

    是麻煩很多,相對也因為需要讓 php 支援比較多的功能,所以乾脆重新編譯客製化自己需要的環境。

  2. 你是用Linux or BSD?
    為何不用RPM裝? 或是PORTS 呢~~
    雖然用configure 也ok~~只是感覺比較麻煩:p
    我是建議啦不要罵我:p

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *