Today, I re-installed PHP under Fedora16. By the way, I will try 5.4. I chose the latest stable version for most of the software involved. Note that a compilation parameter of PHP is -- with-gd = shared. You cannot replace shared with the installation directory/usr/local/gd2 of gd2, otherwise it will not be able to compile through, the Internet looked up like a bug of PHP5.3-5.4. Yuminstall-ygccg-c ++ gcc-c ++
Today, I have reinstalled PHP under Fedora 16. By the way, I have a taste of 5.4. I chose the latest stable version for most of the software involved during this period. Note that a compilation parameter of PHP is -- with-gd = shared. You cannot replace shared with the installation directory/usr/local/gd2 of gd2, otherwise it will not be able to compile through, the Internet looked up like a bug of PHP5.3-5.4.
Yum install-y gcc g-c ++ gcc-c ++ libtool openssl-devel pam-devel python-devel libxml2-devel
Sourcepath = "/opt/source /"
Cd {$ sourcepath}
Wget http://fossies.org/unix/misc/zlib-1.2.6.tar.gz
Mkdir/usr/local/zlib
Tar zxvf zlib-1.2.6.tar.gz
Cd zlib-1.2.6
./Configure -- prefix =/usr/local/zlib
Make & make install
Echo "/usr/local/zlib/lib">/etc/ld. so. conf
Ldconfig
Chcon-t textrel_shlib_t/usr/local/zlib/lib/libz. so *
Cd {$ sourcepath}
Wget http://xmlsoft.org/sources/libxml2-2.7.8.tar.gz
Tar zxvf libxml2-2.7.8.tar.gz
Cd libxml2-2.7.8
./Configure -- prefix =/usr/local/libxml2 -- with-python
Make
Make install
LD_LIBRARY_PATH =/usr/local/lib
LD_LIBRARY_PATH =/usr/local/libxml2/lib
LD_LIBRARY_PATH =/usr/lib/python2.7/site-packages
Echo "/usr/local/libxml2/lib">/etc/ld. so. conf
Echo "/usr/lib/python2.7/site-packages">/etc/ld. so. conf
Ldconfig
Cd {$ sourcepath}
Wget http://xmlsoft.org/sources/libxslt-1.1.26.tar.gz
Mkdir/usr/local/libxslt
Tar zxvf libxslt-1.1.26.tar.gz
Cd libxslt-1.1.26
./Configure -- prefix =/usr/local/libxslt -- with-libxml-prefix =/usr/local/libxml2
Make
Make install
Echo "/usr/local/libxslt/lib">/etc/ld. so. conf
Echo "/usr/local/libxslt/lib/python2.7/site-packages">/etc/ld. so. conf
Ldconfig
Cd {$ sourcepath}
Wget http://vps.googlecode.com/files/libiconv-1.13.1.tar.gz
Mkdir/usr/local/libiconv
Tar zxvf libiconv-1.13.1.tar.gz
Cd libiconv-1.13.1
./Configure -- prefix =/usr/local/libiconv
Make
Make install
Echo "/usr/local/libiconv/lib">/etc/ld. so. conf
Ldconfig
Cd {$ sourcepath}
Wget http://vps.googlecode.com/files/mhash-0.9.9.9.tar.gz
Tar zxvf mhash-0.9.9.9.tar.gz
Cd mhash-0.9.9.9
./Configure
Make
Make install
Echo "/usr/local/lib">/etc/ld. so. conf
Ln-s/usr/local/lib/libmhash. a/usr/lib/libmhash.
Ln-s/usr/local/lib/libmhash. la/usr/lib/libmhash. la
Ln-s/usr/local/lib/libmhash. so/usr/lib/libmhash. so
Ln-s/usr/local/lib/libmhash. so.2/usr/lib/libmhash. so.2
Ln-s/usr/local/lib/libmhash. so.2.0.1/usr/lib/libmhash. so.2.0.1
Ldconfig
Cd {$ sourcepath}
Wget http://vps.googlecode.com/files/libmcrypt-2.5.8.tar.gz
Mkdir/usr/local/libmcrypt
Tar zxvf libmcrypt-2.5.8.tar.gz
Cd libmcrypt-2.5.8/libltdl
./Configure -- enable-ltdl-install
Make
Make install
Echo "/usr/local/lib">/etc/ld. so. conf
Ldconfig
Cd {$ sourcepath}
Cd libmcrypt-2.5.8
./Configure -- prefix =/usr/local/libmcrypt
Make & make install
Ln-s/usr/local/libmcrypt/lib/libmcrypt. la/usr/lib/libmcrypt. la
Ln-s/usr/local/libmcrypt/lib/libmcrypt. so/usr/lib/libmcrypt. so
Ln-s/usr/local/libmcrypt/lib/libmcrypt. so.4/usr/lib/libmcrypt. so.4
Ln-s/usr/local/libmcrypt/lib/libmcrypt. so.4.4.8/usr/lib/libmcrypt. so.4.4.8
Cp/usr/local/libmcrypt/bin/libmcrypt-config/usr/bin/libmcrypt-config
Cp/usr/local/libmcrypt/lib/libmcrypt. */usr/lib
Echo "/usr/local/libmcrypt/lib">/etc/ld. so. conf
Ldconfig
Cd {$ sourcepath}
Wget http://vps.googlecode.com/files/mcrypt-2.6.8.tar.gz
Mkdir/usr/local/mcrypt
Tar zxvf mcrypt-2.6.8.tar.gz
Cd mcrypt-2.6.8
LD_LIBRARY_PATH =/usr/local/lib
./Configure -- prefix =/usr/local/mcrypt -- with-libmcrypt-prefix =/usr/local/libmcrypt -- with-libiconv-prefix =/usr/local/libiconv
Make & make install
Cd {$ sourcepath}
Wget http://curl.cs.pu.edu.tw/download/curl-7.25.0.tar.gz
Tar zxvf curl-7.25.0.tar.gz
Cd curl-7.25.0
./Configure
Make & make install
Ldconfig
Cd {$ sourcepath}
Wget http://download.savannah.gnu.org/releases/freetype/freetype-2.4.9.tar.gz
Mkdir/usr/local/freetype2
Tar zxvf freetype-2.4.9.tar.gz
Cd freetype-2.4.9
./Configure -- prefix =/usr/local/freetype2
Make & make install
Echo "/usr/local/freetype2/lib">/etc/ld. so. conf
Ldconfig
Cd {$ sourcepath}
Wget http://freedesktop.org/software/fontconfig/release/fontconfig-2.9.0.tar.gz
Mkdir/usr/local/fontconfig
Tar zxvf fontconfig-2.9.0.tar.gz
Cd fontconfig-2.9.0
Export PKG_CONFIG_PATH =/usr/local/libxml2/lib/pkgconfig: $ PKG_CONFIG_PATH
Cp-r/usr/local/libxml2/include/libxml2/libxml // usr/include/
./Configure -- prefix =/usr/local/fontconfig -- with-freetype-config =/usr/local/freetype2/bin/freetype-config
Make & make install
Echo "/usr/local/fontconfig/lib">/etc/ld. so. conf
Ldconfig
Cd {$ sourcepath}
Wget ftp://ftp.simplesystems.org/pub/libpng/png/src/libpng-1.5.9.tar.gz
Mkdir/usr/local/libpng2
Tar zxvf libpng-1.5.9.tar.gz
Cd libpng-1.5.9/
Export LDFLAGS =-L/usr/local/zlib/lib
Export CFLAGS =-I/usr/local/zlib/include
./Configure -- prefix =/usr/local/libpng2
Make & make install
Echo "/usr/local/libpng2/lib">/etc/ld. so. conf
Ldconfig
Cd {$ sourcepath}
Wget http://www.ijg.org/files/jpegsrc.v8d.tar.gz
Mkdir/usr/local/limit 8
Mkdir/usr/local/ipv8/include
Mkdir/usr/local/ipv8/lib
Mkdir/usr/local/partition 8/bin
Mkdir/usr/local/sort 8/man/man1/-p
Tar zxvf restart src.v8d.tar.gz
Cd jpeg-8d
./Configure -- prefix =/usr/local/route 8 -- enable-shared -- enable-static
Make & make install
Echo "/usr/local/ipv8/lib">/etc/ld. so. conf
Ldconfig
Cd {$ sourcepath}
Wget http://google-desktop-for-linux-mirror.googlecode.com/files/gd-2.0.35.tar.gz
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/defaults 8 -- with-freetype =/usr /local/freetype2 -- with-xml =/usr/local/libxml2 -- with-png =/usr/local/libpng2 -- with-fontconfig =/usr/local/fontconfig --- slt =/usr/local/libxslt
Make & make install
Echo "/usr/local/gd2/lib">/etc/ld. so. conf
Ldconfig
Cd {$ sourcepath}
Wget http://fossies.org/linux/misc/giflib-4.1.6.tar.gz
Tar zxvf giflib-4.1.6.tar.gz
Cd giflib-4.1.6
./Configure
Make & make install
Cd {$ sourcepath}
Wget http://www.php.net/get/php-5.4.0.tar.gz/from/cn2.php.net/mirror
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/defaults 8 -- 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 -- -mysql =/usr/local/mysql -- with-mysqli =/usr/local/mysql/bin/mysql_config -- with-pdo-mysql =/usr/local/mysql --- 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
Modify/usr/local/apache2/conf/httpd. conf
AddType application/x-compress. Z
AddType application/x-gzip. gz. tgz
Add
PHPIniDir "/etc"
AddType application/x-httpd-php. php
Restart apache!
For more information about Fedora, see Fedora topics page http://www.linuxidc.com/topicnews.aspx? Tid = 5