I. Preparations before installation
Cd/usr/local/src
wget http:
//cn2
.php.net
/distributions/php-5
.4.7.
tar
.gz
yum -y
install
gcc automake autoconf libtool
make
yum -y
install
gcc gcc-c++ glibc
yum -y
install
libmcrypt-devel mhash-devel libxslt-devel \
libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel \
zlib zlib-devel glibc glibc-devel glib2 glib2-devel
bzip2
bzip2
-devel \
ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel \
Krb5 krb5-devel libidn-devel openssl-devel
1. Compile and install the supported libraries required for PHP 5.2.13:
Tar zxvf libiconv-1.14.tar.gz
Cd libiconv-1.13/
./Configure -- prefix =/usr/local
Make
Make install
Cd ../
Tar zxvf libmcrypt-2.5.8.tar.gz
Cd libmcrypt-2.5.8/
./Configure
Make
Make install
/Sbin/ldconfig
Cd libltdl/
./Configure -- enable-ltdl-install
Make
Make install
Cd ../../
Tar zxvf mhash-0.9.9.9.tar.gz
Cd mhash-0.9.9.9/
./Configure
Make
Make install
Cd ../
Tar zxvf mcrypt-2.6.8.tar.gz
Cd mcrypt-2.6.8/
/Sbin/ldconfig
./Configure
Make
Make install
Cd ../
II. Start Installation
tar
zvxf php-5.5.7.
tar
.gz
cd
Php-5.5.7
. /Configure -- prefix =/usr/local/php -- with-config-file-path =/usr/local/php/etc -- with-mysql =/usr/local/mysql -- with-mysqli =/usr/local/mysql/bin/mysql_config -- with-iconv-dir =/usr/local -- with-freetype-dir -- with-jpeg-dir --- png-dir -- with-zlib -- with-libxml-dir =/usr -- enable-xml -- disable-rpath -- enable-discard-path -- enable-safe-mode -- enable-bcmath -- enable-shmop -- enable-sysvsem -- enable-inline-optimization -- with-curl -- with-curlwrappers -- enable-mbregex -- enable-fastcgi -- enable-fpm -- enable-force-cgi -redirect -- enable-mbstring -- with-mcrypt -- with-gd -- enable-gd-native-ttf -- with-openssl -- with-mhash -- enable-pcntl -- enable-sockets -- -ldap -- with-ldap-sasl -- with-xmlrpc -- enable-zip -- enable-soap
Make ZEND_EXTRA_LIBS = '-liconv' (remember this, otherwise the variation will not pass)
Make install
If you cannot find php. ini, copy the Current Directory php. ini-product to/usr/local/php/lib, and configure php. ini.
Then configure your php-fpm.conf. Under/usr/local/etc,
Mv php-fpm.conf.default php-fpm.conf
3. Install pdo mysql
Tar zxvf PDO_MYSQL-1.0.2.tgz
Cd PDO_MYSQL-1.0.2/
/Usr/local/php/bin/phpize
./Configure -- with-php-config =/usr/local/php/bin/php-config -- with-pdo-mysql =/usr/local/mysql
Make
Make install
Cd ../
If the error message ". ln-s/usr/local/mysql/include/usr/local/include" is returned
This is because the header file of mysql cannot be found.
4. Install xcache
Wget http://xcache.lighttpd.net/wiki/Release-3.1.0
Tar zxvf xcache-3.1.0
/Usr/local/php/bin/phpize
./Configure -- with-php-config =/usr/local/php/bin/php-config -- enable-xcache-optimizer
Make
Make install
5. Configure xcache
Cat xcache. ini>/etc/php. iniEcho-n "12345" | replace md5sum with your desired username and the password generated aboveXcache. admin. user = "mOo" xcache. admin. pass = "5f4dcc3b5aa765d61d8327deb882cf99" installation background managementCp-~ /Src/xcache/htdocs/var/www/example.com/htdocs/xcache-adminThe website directory of/var/www/example.com/htdocs.pdf