PHP 5.5以後加速外掛程式:Zend Opcache

來源:互聯網
上載者:User

標籤:style   blog   http   io   color   os   sp   檔案   div   

大家知道目前PHP的快取區外掛程式一般有三個: APC、 eAccelerator、 XCache,但未來它們可能都會消失,因為PHP 5.5已經整合 Zend Opcache,功能和前三者相似但又有少許不同,緩衝速度據說比它們更快(注意:只是據說,我沒測試過)。

php5.5以後版本編譯eAccelerator報錯如下:

eaccelerator.c:66:23: error: php_logos.h: No such file or directory

究其原因是PHP5.5以下版本有php_logos.c,php_logos.h等檔案。

如果想在新版本繼續用加速,目前知道是的php內建擴充 opcache。

操作如下:

cd /usr/local/src/php-5.6.0/ext/opcache
/usr/local/webserver/php/bin/phpize
./configure --with-php-config=/usr/local/webserver/php/bin/php-config
make && make install

最好修改/etc/php.ini在最後加入

[opcache]zend_extension=/usr/local/webserver/php/lib/php/extensions/no-debug-non-zts-20131226/opcache.soopcache.memory_consumption=128opcache.interned_strings_buffer=8opcache.max_accelerated_files=4000opcache.revalidate_freq=60opcache.fast_shutdown=1opcache.enable_cli=1

重啟php-fpm:

 

來源:

http://www.lkycn.com/2014/10/10/39.html

http://www.xuebuyuan.com/2039268.html

PHP 5.5以後加速外掛程式:Zend Opcache

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.