標籤: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