cd {$sourcepath}
wget
mkdir /usr/local/jpeg8
mkdir /usr/local/jpeg8/include
mkdir /usr/local/jpeg8/lib
mkdir /usr/local/jpeg8/bin
mkdir /usr/local/jpeg8/man/man1/ -p
tar zxvf jpegsrc.v8d.tar.gz
cd jpeg-8d
./configure --prefix=/usr/local/jpeg8 --enable-shared --enable-static
make && make install
echo "/usr/local/jpeg8/lib" >> /etc/ld.so.conf
ldconfig
cd {$sourcepath}
wget
mkdir /usr/local/gd2
tar zxvf gd-2.0.35.tar.gz
cd gd/2.0.35
cp /usr/local/libpng2/include/pngconf.h {$sourcepath}gd/2.0.35/
./configure --prefix=/usr/local/gd2 --with-zlib=/usr/local/zlib --with-jpeg=/usr/local/jpeg8 --with-freetype=/usr/local/freetype2 --with-xml=/usr/local/libxml2 --with-png=/usr/local/libpng2 --with-fontconfig=/usr/local/fontconfig --with-slt=/usr/local/libxslt
make && make install
echo "/usr/local/gd2/lib" >> /etc/ld.so.conf
ldconfig
cd {$sourcepath}
wget
tar zxvf giflib-4.1.6.tar.gz
cd giflib-4.1.6
./configure
make && make install
cd {$sourcepath}
wget
tar zxf php-5.4.0.tar.gz
cd php-5.4.0
./configure --prefix=/usr/local/php --with-config-file-path=/etc --with-apxs2=/usr/local/apache2/bin/apxs --with-gd=shared --with-jpeg-dir=/usr/local/jpeg8 --with-png-dir=/usr/local/libpng2 --enable-gd-native-ttf --with-zlib-dir=/usr/local/zlib --with-freetype-dir=/usr/local/freetype2 --enable-zip --with-libxml-dir=/usr/local/libxml2 --with-MySQL=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-pdo-mysql=/usr/local/mysql --with-pgsql=/usr/local/pgsql --with-pdo-pgsql=/usr/local/pgsql --with-curl --with-mcrypt=/usr/local/libmcrypt --enable-mbstring=all --with-mhash --enable-soap --enable-sockets --with-pear --enable-gd-native-ttf --enable-ftp --disable-ipv6 --with-iconv
make
make test
make install
修改/usr/local/apache2/conf/httpd.conf
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
下面添加
PHPIniDir "/etc"
AddType application/x-httpd-php .php
重启apache,搞定!
更多Fedora相关信息见Fedora 专题页面 ?tid=5