One, prepare 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 libidn-devel openssl openssl-devel
1、编译安装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 ../
Two. 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-- With-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--with-ldap- -WITH-LDAP-SASL--with-xmlrpc--enable-zip--enable-soap
Make zend_extra_libs= '-liconv ' (remember this, otherwise the mutation does not pass)
Make install
If the php.ini is not found, copy the current directory php.ini-product to/usr/local/php/lib and configure the php.ini
Then configure you to php-fpm.conf. Under/usr/local/etc/,
MV Php-fpm.conf.default php-fpm.conf
Three-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 there is an error. Ln-s/usr/local/mysql/include/usr/local/include
This is because the header file for MySQL could not be found
Four, 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--enable-xcache-optimizer
Make
Make install
Five Configuration XCache
Cat Xcache.ini >>/etc/php.iniEcho-n "12345" |md5sum replaced with the username you want, and generate the password aboveXcache.admin.user = "MOo" Xcache.admin.pass = "5f4dcc3b5aa765d61d8327deb882cf99" Install background managementCp-a ~/src/xcache/htdocs/var/www/example.com/htdocs/xcache-admin/var/www/example.com/htdocs for your Site Directory
http://www.bkjia.com/PHPjc/635064.html www.bkjia.com true http://www.bkjia.com/PHPjc/635064.html techarticle First , prepare cd/usr/local/src wget http://cn2. php.net/distributions/php-5.4.7. Tar. GZ yum-y install gcc automake aut oconf libtool make yum-y install gcc gcc-c glib ...