This article describes how to install the PHPxcache extension module in CentOS6.3. This article includes the compilation, installation, configuration, and testing of xchache. If you need it, refer to the installation environment centOS6.3.
APACHE: apache-2.4.4
PHP: 5.4.13
1. Install xchache:
The Code is 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 is an extension of php that needs to be loaded using php commands
#/Usr/local/php5/bin/phpize # The phpize command is used to prepare a php extension for compilation. Therefore, the extension must be compiled first.
#./Configure -- enable-xcache -- with-php-config =/usr/local/php5/bin/php-config
# Php-config indicates that php configuration information and compilation options can be obtained;
# Because it is not in the default path, xcache needs to obtain the features enabled during php installation. Otherwise, xcache cannot find the php path.
# Make
# Make install
At the end of installation, the following lines will appear:
The Code is as follows:
Installing shared extensions:/usr/local/php/lib/php5/extensions/no-debug-zts-20100525/
# Install the shared extension module path. Copy the path to the xcache configuration file.
2. Edit php. ini and integrate php and xcache.
The Code is as follows:
# Cd xcache-3.0.1
# Vi xcache. ini
Add the content in the xcache configuration file to the PHP configuration file/usr/local/php5/lib/php. ini.
And find the extension line and change it
The Code is as follows:
Extension =/usr/local/php5/lib/php/extensions/no-debug-zts-20100525/xcache. so
Restart service
The Code is as follows:
Service httpd restart
3. added the phpinfo function to the test page.
Add info. php to/usr/local/apache2/htdocs/to test whether the php module is loaded.
The Code is as follows:
# Vi/usr/local/apache2/htdocs/info. php
---------------
<? Php
Echo phpinfo ();
?>
---------------
Check whether port 80 is enabled
The Code is as follows:
# Lsof-I: 80
Enter http: // localhost/info. php In the browser
The following test page is displayed. The PHP module is successfully loaded under APACHE.