Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to enable OPCache for PHP7.1 on MAC Sierra (MAMP)

Tags:

php

macos

opcache

I've installed OPCache GUI from GitHub and installed in my Mac. But when I run the page, it shows

The Zend OPcache extension is installed but not turned on

I've enabled the OPCache in my php.ini file with these

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

Please help!

like image 296
owen Avatar asked Nov 19 '22 01:11

owen


1 Answers

I found that no matter what you set in php.ini the cache is always shown as disabled. The only way that worked, was to activate OPcache directly in the MAMP GUI.

Where you find these settings depends on the MAMP variant (standard or pro):

MAMP PRO

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

enter image description here

MAMP

Settings → General → Cache → OPcache

enter image description here

like image 178
insertusernamehere Avatar answered Jan 12 '23 11:01

insertusernamehere