Install opcache in php5.3LNMP integrated environment

Source: Internet
Author: User
Tags apc
Php5.3LNMP integrated environment install opcache you know that there are currently three PHP Cache plug-ins: APC, eAccelerator, and XCache, but they may disappear in the future, because PHP 5.5 has already integrated Zend Opcache, features are similar to those of the first three, but they are a little different. the cache speed is said to be faster than them.

The main principles of these PHP acceleration plug-ins are the same. they are to buffer the executed PHP data into the memory to avoid repeated compilation processes, you can directly use the compiled code in the buffer zone to increase the speed and reduce the server load. their efficiency is obvious, such as the huge CMS such as drupal, each time you open a page, you need to call dozens of PHP files and execute tens of thousands of lines of code. the efficiency can be imagined. after installing the APC and other accelerators, the page opening speed is significantly faster.

The following describes how to install opcache in the LNMP environment of your virtual machine.

Wget https://pecl.php.net/get/zendopcache-7.0.4.tgztar zxvf zendopcache-7.0.4.tgzcd zendopcache-7.0.4./configure -- with-php-config =/usr/local/php/bin/php-configmakemake install

Then modify php. ini.

Vim/usr/local/php/etc/php. add the following content to ini: zend_extension =/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/opcache. soopcache. memory_consumption = 128opcache. interned_strings_buffer = 8opcache. max_accelerated_files = 4000opcache. revalidate_freq = 60opcache. fast_shutdown = 1opcache. enable_cli = 1

Restart php-fpm. /Etc/init. d/php-fpm restart

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.