php - 如何在 MAC Sierra (MAMP) 上为 PHP7.1 启用 OPCache

标签 php macos opcache

我已经从 GitHub 安装了 OPCache GUI并安装在我的 Mac 上。但是当我运行页面时,它显示

The Zend OPcache extension is installed but not turned on



我已经使用这些在我的 php.ini 文件中启用了 OPCache

opcache.enable=1
opcache.enable_cli=1
zend_extension=opcache.so
opcache.memory_consumption=128
opcache.max_accelerated_files=2500
opcache.interned_strings_buffer=8
opcache.revalidate_freq=60
opcache.fast_shutdown=1
zend_extension=/path/to/opcache.so/file



请帮忙!

最佳答案

我发现无论你在 php.ini 中设置了什么缓存始终显示为禁用。唯一有效的方法是激活 OPcache直接在 MAMP GUI 中。
您在何处找到这些设置取决于 MAMP 变体(标准版或专业版):
MAMP专业版

Language → PHP Settings → Cache module to speed up PHP execution → OPcache


enter image description here
MAMP

Settings → General → Cache → OPcache


enter image description here

关于php - 如何在 MAC Sierra (MAMP) 上为 PHP7.1 启用 OPCache,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42724120/

相关文章:

php - laravel 中的嵌套资源

arrays - 将 CSV 文件的内容加载到数组而不打开文件

cocoa - NSOutlineView - 启动时滚动到顶部

caching - Codeigniter 缓存 Opcache 和 APCu

php - Opcache 导致 PHP fatal error : Class '\xa0L\xdaor\x7f' not found

php - 电话可以用来传播本地主机的使用吗?

php - 从 PHP 数组中删除随机项

php 使用 preg_replace 将 url 转换为链接..... 有时.... :P

swift - 配置 Interface Builder 的新 WKWebView 对象

php - 如何启用 opcache.load_comments php 7.1