Linux directadmin Add XCache tutorial

Source: Internet
Author: User
Tags zts zend

XCache is an open source opcode cache/optimizer, which means that he can improve PHP performance on your server. By buffering data from the compiled PHP to shared memory to avoid duplication of compilation, he can increase speed by directly using the compiled code of the buffer. Typically, you can increase your page generation rate by 2 to 5 times times and also reduce server load.

First, download and install

cd/usr/local/src/
wget http://xcache.lighttpd.net/pub/Releases/2.0.1/xcache-2.0.1.tar.gz
TAR-ZXVF xcache-2.0.1.tar.gz
CD xcache-2.0.1
Export php_prefix= "/usr/local"
$PHP _prefix/php5/bin/phpize
./configure--enable-xcache-with-php-config= $PHP _prefix/php5/bin/php-config
Make && make install

Second, installation completed, call

Modify PHP.ini "such as DirectAdmin suphp mode installed in/usr/local/etc/php5/cgi"
Add the following to the Zend:

[Xcache-common]
Zend_extension =/usr/local/php5/lib/php/extensions/no-debug-non-zts-20090626/xcache.so
[Xcache.admin]
Xcache.admin.user = "Admin"
Xcache.admin.pass = ""
; Xcache.admin.pass = MD5 ($your _password)
Xcache.admin.enable_auth = On
[XCache]
Xcache.cacher = On
Xcache.size = 64M
Xcache.count = 1
Xcache.slots = 8K
Xcache.ttl = 3600
Xcache.gc_interval = 300
Xcache.var_size = 0M
Xcache.var_count = 1
Xcache.var_slots = 8K
Xcache.var_ttl = 0
Xcache.var_maxttl = 0
Xcache.var_gc_interval = 300
Xcache.readonly_protection = Off
Xcache.mmap_path = "/dev/zero"

Third, restart Apache

Service httpd Restart

There are two points to note here, mentioned below.

1th, when we modify the php.ini, we must put the content of XCache added to the top of the Zend;

2nd, I also tested the same process on the PHP5.2.17 version, unlike PHP5.3.25, the Extension_dir directory is

/usr/local/php5/lib/php/extensions/no-debug-non-zts-20060613/

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.