<span style="color:#444444;font-family:'Microsoft YaHei';font-size:16px;background-color:#FFFFFF;">本人环境为php5.3,未集成opcache,需要手工编译加载</span>



<span style="color:#444444;font-family:'Microsoft YaHei';font-size:16px;background-color:#FFFFFF;">安装步骤</span>



<span style="color:#444444;font-family:'Microsoft YaHei';font-size:16px;background-color:#FFFFFF;">下载源码包:</span>

<span style="color:#444444;font-family:'Microsoft YaHei';font-size:16px;background-color:#FFFFFF;">wget </span><span style="font-family:'Microsoft YaHei';font-size:16px;">http://pecl.php.net/get/zendopcache-7.0.2.tgz<;/span>

<span style="color:#444444;font-family:'Microsoft YaHei';font-size:16px;background-color:#FFFFFF;">解压包:</span>

<span style="color:#444444;font-family:'Microsoft YaHei';font-size:16px;background-color:#FFFFFF;">tar xzf zendopcache-7.0.2.tgz</span>

<span style="color:#444444;font-family:'Microsoft YaHei';font-size:16px;background-color:#FFFFFF;">切入解压出来的目录</span>

<span style="color:#444444;font-family:'Microsoft YaHei';font-size:16px;background-color:#FFFFFF;">cd zendopcache-7.0.2</span>



<span style="color:#444444;font-family:'Microsoft YaHei';font-size:16px;background-color:#FFFFFF;">设置编译参数(红色字体已军哥LNMP系列一键包为默认路径,非军哥包请根据实际情况修改为你的PHP路径)</span>

<span style="font-family:'Microsoft YaHei';font-size:16px;color:#E53333;background-color:#FFFFFF;">/usr/local/php/bin</span><span style="color:#444444;font-family:'Microsoft YaHei';font-size:16px;background-color:#FFFFFF;">/phpize</span>

<span style="color:#444444;font-family:'Microsoft YaHei';font-size:16px;background-color:#FFFFFF;">./configure --with-php-config=</span><span style="font-family:'Microsoft YaHei';font-size:16px;color:#E53333;background-color:#FFFFFF;">/usr/local/php/bin</span><span style="color:#444444;font-family:'Microsoft YaHei';font-size:16px;background-color:#FFFFFF;">/php-config</span>

<span style="color:#444444;font-family:'Microsoft YaHei';font-size:16px;background-color:#FFFFFF;">开始编译</span>

<span style="color:#444444;font-family:'Microsoft YaHei';font-size:16px;background-color:#FFFFFF;">make && make install</span>



<span style="color:#444444;font-family:'Microsoft YaHei';font-size:16px;background-color:#FFFFFF;">检查/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/ 中是否有opcache.so文件诞生</span>





<p style="color:#444444;font-size:14px;background-color:#FFFFFF;">

<span style="font-family:'Microsoft YaHei';font-size:16px;">在PHP.ini添加如下代码</span>

</p>
<p style="color:#444444;font-size:14px;background-color:#FFFFFF;">

<span style="font-family:'Microsoft YaHei';font-size:16px;"><br />

</span>
</p>
<p style="color:#444444;font-size:14px;background-color:#FFFFFF;">

<span style="font-family:'Microsoft YaHei';font-size:16px;"></span>

</p>

[Zend Opcache]
zend_extension= /usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/opcache.so
opcache.memory_consumption=64
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=4000
opcache.force_restart_timeout=180
opcache.revalidate_freq=60
opcache.fast_shutdown=1
opcache.enable_cli=1

<div>

<br />

</div>

Last modification:December 13th, 2017 at 11:43 pm