Installation Environment centOS6.3
apache:apache-2.4.4
php:5.4.13
1. Install Xchache:
Copy Code code as follows:
# wget http://xcache.lighttpd.net/pub/Releases/3.0.1/xcache-3.0.1.tar.gz
# Tar XF xcache-3.0.1.tar.gz
# CD xcache-3.0.1 #xcache是php的扩展, to load this extension with the PHP command
#/usr/local/php5/bin/phpize #phpize命令作用是要准备一个php扩展准备编译, so the extension has to perform the compilation first
#./configure--enable-xcache--with-php-config=/usr/local/php5/bin/php-config
#php-config represents the ability to obtain PHP configuration information and compile-time option information;
# #由于不在默认路径下, XCache to get the functionality enabled by the PHP installation, XCache will not find the path to PHP
#make
#make Install
At the end of the installation, something like the following line appears:
Copy Code code as follows:
Installing Shared extensions:/usr/local/php/lib/php5/extensions/no-debug-zts-20100525/
#安装共享扩展模块路径, copy this path first, wait, copy it to the XCache profile.
2 edit php.ini, integrate PHP and XCache
Copy Code code as follows:
# CD xcache-3.0.1
# VI Xcache.ini
Add the content under the XCache profile to the PHP configuration file/usr/local/php5/lib/php.ini
and find extension this line and fix it instead
Copy Code code as follows:
Extension =/usr/local/php5/lib/php/extensions/no-debug-zts-20100525/xcache.so
Restart Service
Copy Code code as follows:
3. Add phpinfo function, test page
Add the following info.php to/usr/local/apache2/htdocs/to test whether the PHP module is loaded.
Copy Code code as follows:
# vi/usr/local/apache2/htdocs/info.php
---------------
<?php
Echo Phpinfo ();
?>
---------------
Check if port 80 is open
Copy Code code as follows:
Browser input http://localhost/info.php
Display the following test page content, PHP module that is loaded under Apache success