7

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!

7
  • did you restart your server after enabling it? Are you running plain apache or using MAMP? Can you print your phpinfo(); Commented Mar 10, 2017 at 17:18
  • Yes. I did restart my server. My Mac is running MAMP. Yes, I can print my phpinfo(), which portion of the phpinfo() do I have to display? Commented Mar 10, 2017 at 17:29
  • See if you can find opcache.enable in php info. Also make sure that you modified the right php.ini. MAMP has a bunch of them stored for every version of php ex: /Applications/MAMP/bin/php/php5.5.3/conf/php.ini Commented Mar 10, 2017 at 17:34
  • Oops. opcache.enable is "Off" in phpinfo(). But it's strange, I've installed php 7.1. But in the /Applicaations/MAMP/bin/php/ folder, I cannot find php 7.1, instead there are 5.3, 5.4, 5.6, 7. I've tried edited the 7. But still doesn't work. Can't find 5.5.3 btw. Commented Mar 10, 2017 at 17:41
  • find out which php.ini your server is using in phpinfo if you can. Commented Mar 10, 2017 at 17:46

1 Answer 1

3

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

Sign up to request clarification or add additional context in comments.

4 Comments

how bout non-pro MAMP?
@AlanYong MAMP > Preferences > General > PHP-Cache > OPCache
I cannot activate OPcache in the MAMP GUI. It can be selected, but it does not save that selection. It is ALWAYS going back to "off" in the GUI. And PHPAdmin shows it is off. I'm using MAMP 6.4 and php 7.4.16 and trying to edit the file at MAMP > bin > php > php7.4.16 > conf > php.ini lines 1738 and thereabouts. What am I missing?
@Rillieux Found a workaround stackoverflow.com/questions/74769696/…

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.