PhP5 xcache Installation Guide

Source: Internet
Author: User
Tags apc zts

Xcache is a fast and stable PHP code-level cache that provides an effective buffer layer for servers under high load environments. Buffers similar to eaccelerator and APC are available.

This article describes how to install xcache pai_^ for PHP.

Test Environment setup

I used apache2 + PhP5 in centos5.5 to build a simple test environment. The website root directory is under/var/www/html.

View Current PhP5 Configuration

Before installing xcache, check your PHP configuration, create info. php in the/var/www/html directory, and write the following code:

?
1 touch
/var/www/html/info
.php
?
123 <?php phpinfo(); ?>

View the phpinfo information in the browser, http: // localhost/info. php

Of course, you still cannot see the xcache installation information.

If you see other caches in the configuration, such as eaccelerator or APC, You need to delete them first:

?
123456 # Deleting an eaccelerator
yum remove php-eaccelerator
# Delete APCyum remove php-pecl-apc
Restart the httpd server/etc/init.d/httpd
restart

Start xcache Installation
Because xcache does not have an existing RPM installation package, we need to manually compile this module.

?
123456789101112131415 yum install
php-devel yum groupinstall
'Development Tools'yum groupinstall
'Development Libraries'# Download the latest xcache and decompress it
cd
/tmp
wget http://xcache.lighttpd.net/pub/Releases/1.3.0/xcache-1.3.0.tar.gz
tar
xvfz xcache-1.3.0.
tar.gz
cd
xcache-1.3.0
# Use phpize tool to compile xcache
phpize ./configure
--enable-xcache
makemake
install
# Copy the xcache configuration file to the PHP configuration directory.
cp
xcache.ini
/etc/php.d

Configure xcache

?
1234567891011121314 vi
/etc/php
.d/xcache.ini
[xcache-common] ;; install
as zend extension (recommended), normally "$extension_dir/xcache.so";zend_extension =
/usr/local/lib/php/extensions/non-debug-non-zts-xxx/xcache.so
; zend_extension_ts =
/usr/local/lib/php/extensions/non-debug-zts-xxx/xcache.so
;; For windows
users, replace xcache.so with php_xcache.dll
;zend_extension_ts = c:/php/extensions/php_xcache.dll
;; or install
as extension, make
sure your extension_dir setting is correct extension = xcache.so
;; or win32: ; extension = php_xcache.dll
[...] xcache.size  =                60M
[...]

Restart Apache server

?
1 /etc/init.d/httpd
restart

View the phpinfo information again. If you see the following two images, congratulations! The configuration is successful.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.