PHP Cache Acceleration Plugin XCache, Zendopcache installation

Source: Internet
Author: User
Tags zts install perl

PHP Caching principle

When the client requests a PHP program, the server's PHP engine parses the PHP program and compiles it into a specific opcode (operatecode, abbreviated opcode) file, which is a binary representation of the PHP code. By default, this compiled opcode file is discarded by the PHP engine, and the opcode cache (Opcode cache) is the principle of saving the compiled opcode to shared memory so that the next time the same PHP program is called again, the code is reused, avoiding repeated compilation of the same It saves the PHP engine time to compile repeatedly, reduces server load and saves CPU and memory overhead, and the main cache accelerator plug-ins are eaccelerator, XCache, Zendopcache and so on.

XCache Cache plug-in deployment

XCache is an open source, fast and stable Phpopcode Cache plugin whose project leader was once a member of LIGHTTPD's development. XCache the php compiled opcode to the shared memory, avoid the same program repeatedly compiled. When users request the same PHP program, they can directly use the data that has been compiled in the cache to improve access to PHP, typically up to 2-5 times faster, and significantly reduce server load overhead. Many companies use XCache, which has been able to run stably in a high-volume, heavy-duty production environment, better than the same type of Opcache cache plug-in, while XCache community is active, fast-developing and able to quickly follow up on PHP version updates. The current 3.2 version fully supports php5.1-5.6, the official website http://xcache.lighttpd.net

echo $LC _allecho "Export lc_all=c" >>/etc/profilesource/etc/profileyum install Perl-devel-y
#注: Before doing PHP extension to do the above environment configuration, so as to avoid the compilation process error Cd/server/tools/wget http://xcache.lighttpd.net/pub/Releases/3.2.0/ Xcache-3.2.0.tar.gztar XF XCACHE-3.2.0.TAR.GZCD xcache-3.2.0/application/php/bin/phpize./configure--enable-xcache --with-php-config=/application/php/bin/php-configmake Make Installvim/application/php/lib/php.iniextension_dir = " /application/php-5.3.27/lib/php/extensions/no-debug-non-zts-20090626/"cp Xcache.ini xcache.ini.bakgrep-v" ^; Xcache.ini.bak > Xcache.iniecho-n "123456" | Md5sume10adc3949ba59abbe56e057f20f883e-vim xcache.ini[xcache-common]extension = Xcache.so[xcache.admin] Xcache.admin.enable_auth = Onxcache.admin.user = "Peter" Xcache.admin.pass = "e10adc3949ba59abbe56e057f20f883e" [ Xcache]xcache.shm_scheme = "Mmap" xcache.size = 256M Xcache.count = 1xcache.slot s = 8kxcache.ttl = 86400xcache.gc_interval = 3600xcache.var_size = 64M ... #含义: Memory allocation method Cache size How many blocks the cache is cut into, recommended to be set to the number of CPUs grep-c procEssor/proc/cpuinfohash slot Number Object Lifetime scan the size of the periodic variable cache to reclaim expired data echo "; XCache config by Peter" >>/application/php/lib/ Php.inicat Xcache.ini >>/application/php/lib/php.ini/application/php/bin/php-vphp 5.3.27 (CLI) (Built:sep 14 11:03:50) Copyright (c) 1997-2013 the PHP groupzend Engine v2.3.0, Copyright (c) 1998-2013 Zend Technologies with X Cache v3.2.0, Copyright (c) 2005-2014, by Moo with XCache Cacher v3.2.0, Copyright (c) 2005-2014, by Moo
#配置web监控界面cp-a htdocs//application/nginx/html/xadminchown-r Nginx.nginx/application/nginx/html/xadminpkill Php-fpm/application/php/sbin/php-fpmhttp://172.16.1.88/xadmin

Zendopcache Cache plug-in deployment starting from PHP5.5, the official has integrated a new generation of cache accelerator plug-in Zendopcache, compile PHP with only a--enable-opcache, according to the official said cache faster. For earlier versions of PHP, you need to install Zendopcache in the form of an extension that supports php5.3-5.4.
Cd/server/toolswget Http://pecl.php.net/get/zendopcache-7.0.5.tgztar XF ZENDOPCACHE-7.0.5.TGZCD zendopcache-7.0.5/ Application/php/bin/phpize./configure--enable-opcache--with-php-config=/application/php/bin/php-configmakemake installls/application/php-5.3.27/lib/php/extensions/no-debug-non-zts-20090626/vim/application/php/lib/php.ini[ opcache]zend_extension=/application/php-5.3.27/lib/php/extensions/no-debug-non-zts-20090626/opcache.so; Extension=opcache.soopcache.memory_consumption=128opcache.interned_strings_buffer=8opcache.max_accelerated_ files=4000opcache.revalidate_freq=60opcache.fast_shutdown=1opcache.enable_cli=1# Meaning: Cache size buffer size Hash list key Maximum number, OpCode file count Check file timestamp cycle activation Fast close queue, can accelerate code activation PHPCLI Opcache for testing and debugging [[email protected] zendopcache-7.0.5]#/ application/php/bin/php-vphp 5.3.27 (CLI) (Built:sep 11:03:50) Copyright (c) 1997-2013 the PHP groupzend Engine v 2.3.0, Copyright (c) 1998-2013 Zend Technologies with Zend opcache v7.0.5, Copyright (c) 1999-2015, by Zend Technologies 
What is Phpize?

With Phpize you can build a PHP plug-in module, before compiling the extension module to be added, you need to perform a phpize.

PHP Cache Acceleration Plugin XCache, Zendopcache installation

Related Article

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.