[四]安裝GD Graphics Library 與 安裝php5

a.安裝 jpeg6 部份﹕
# mkdir -p /usr/local/jpeg6
# mkdir -p /usr/local/jpeg6/bin
# mkdir -p /usr/local/jpeg6/lib
# mkdir -p /usr/local/jpeg6/include
# mkdir -p /usr/local/jpeg6/man
# mkdir -p /usr/local/jpeg6/man1
# mkdir -p /usr/local/jpeg6/man/man1

# cd /home/myhome/software/
# tar zvxf jpegsrc.v6b.tar.gz
# cd jpeg-6b
# ./configure --prefix=/usr/local/jpeg6/ --enable-shared --enable-static
# make; make install

b.安裝 libpng 部份
# cd /home/myhome/software/
# tar -zvxf libpng-1.2.8.tar.gz
# cd libpng-1.2.8
# cp scripts/makefile.std makefile
# make; make install

c.安裝 freetype 部份
# cd /home/myhome/software/
# tar zvxf freetype-2.1.10.tar.gz
# cd freetype-2.1.10
# mkdir -p /usr/local/freetype
# ./configure --prefix=/usr/local/freetype
# make;make install

d.安裝zlib 部份
# cd /home/myhome/software/
# tar zxvf zlib-1.2.3.tar.gz
# cd zlib-1.2.3
# ./configure
# make;make install

e.安裝 GD Graphics Library 部份
# cd /home/myhome/software/
# tar zvxf gd-2.0.33.tar.gz
# mkdir -p /usr/local/gd2
# cd gd-2.0.33
# ./configure --prefix=/usr/local/gd2 --with-jpeg=/usr/local/jpeg6/ --with-png=/usr/local/lib/ --with-zlib=/usr/local/lib/ --with-freetype=/usr/local/freetype/
# make; make install

e.安裝 Curl 部份
# cd /home/myhome/software/
# tar zxvf curl-7.16.4.tar.gz
# cd curl-7.16.4
# mkdir -p /usr/local/curl
# ./configure --prefix=/usr/local/curl
# make; make install


f.安裝libxml2(讓php 有libxml2 support)
# cd /home/myhome/software/
# tar zxvf libxml2-2.6.19.tar.gz
# cd libxml2-2.6.19
# mkdir -p /usr/local/libxml2
# ./configure --prefix=/usr/local/libxml2
# make; make install

g.安裝 libxslt
# cd /home/myhome/software/
# tar zxvf libxslt-1.1.15.tar.gz
# mkdir -p /usr/local/libxslt
# cd libxslt-1.1.15
# ./configure --prefix=/usr/local/libxslt --with-libxml-prefix=/usr/local/libxml2
# make; make install

h.安裝php5
# cd /home/myhome/software/
# tar zxvf php-5.2.3.tar.gz
# mkdir -p /usr/local/php
# cd php-5.2.3
# ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with-mysql=/usr/local/mysql/ --with-curl=/usr/local/curl --enable-ftp --with-libxml-dir=/usr/local/libxml2 --with-expat-dir=/usr/lib --enable-soap --with-xsl=/usr/local/libxslt --enable-xslt --with-gd=/usr/local/gd2/ --with-jpeg-dir=/usr/local/jpeg6/ --with-zlib-dir=/usr/local/lib/ --with-png=/usr/local/lib/ --with-freetype-dir=/usr/local/freetype/
# make
# make install
# cp php.ini-dist /usr/local/php/lib/php.ini

其中./configure 后的 --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with-mysql=/usr/local/mysql/ --with-libxml-dir=/usr/local/libxml2 是必要的選項
--with-gd=/usr/local/gd2/ --with-jpeg-dir=/usr/local/jpeg6/ --with-png=/usr/local/lib --with-zlib-dir=/usr/lib --with-freetype-dir=/usr/local/freetype 這是讓PHP支持GD library的選項

--with-curl=/usr/local/curl 支持CURL庫 --enable-ftp 打開FTP 支援

--enable-soap --with-xsl=/usr/local/libxslt --enable-xslt 讓PHP支持SOAP, 上面這些一般用得少, 可以去掉
 

 

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

設定 httpd.conf 讓apache支持PHP
# vi /usr/local/apache/conf/httpd.conf
  找到 AddType application/x-gzip .gz .tgz 加入的內容 如下...
  AddType application/x-httpd-php .php
  AddType application/x-httpd-php-source .phps

重啟apache:
# /usr/local/apache/bin/apachectl restart

apache目錄瀏覽關閉:
vi /usr/local/apache/conf/httpd.conf
Options Indexes FollowSymLinks
去掉 Indexes

 
創作者介紹

資訊理想化的延伸

hsinichi 發表在 痞客邦 PIXNET 留言(0) 人氣()