PHP5.5+集成OPcache

WBOY
Release: 2016-06-23 13:39:22
Original
753 people have browsed it

作者:zhanhailiang 日期:2015-02-28
Copy after login

安装与配置

  1. 下载php-5.6.6.tar.gz

    [root@~/wade/git/billfeller.github.io/code]# wget wget http://cn2.php.net/distributions/php-5.6.6.tar.gz
    Copy after login
  2. 通过 --enable-opcache 开启OPcache:

    ./configure  --prefix=/usr/local/php-5.6.6 --with-pear --with-iconv=/usr/local/ --enable-mysqlnd --with-mysql --with-mysqli --with-openssl --with-libxml-dir --with-curl --with-pdo-mysql --disable-fileinfo --enable-opcache --enable-soap --enable-sockets --enable-fpm --enable-mysqlnd --with-mcrypt --enable-mbstring --enable-debug --enable-maintainer-ztsmake && make install
    Copy after login
  3. 配置php.ini:

    zend_extension=opcache.so[opcache]opcache.memory_consumption=128opcache.interned_strings_buffer=8opcache.max_accelerated_files=4000opcache.revalidate_freq=60opcache.fast_shutdown=1opcache.enable_cli=1
    Copy after login
  4. 测试:

    [root@~/wade/git/billfeller.github.io/code]# /usr/local/php-5.6.6/bin/php -m[Zend Modules]Zend OPcache
    Copy after login

更多阅读

  1. OPcache Installation
  2. 前端开发中的性能那点事(三)php的opcode缓存
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template