2

I am finding it tricky to enable OPcache on my MacOS Sierra (10.12.6) system.

php --ini shows the ini file used:

Configuration File (php.ini) Path: /usr/local/etc/php/7.0 Loaded Configuration File: /usr/local/etc/php/7.0/php.ini Scan for additional .ini files in: /usr/local/etc/php/7.0/conf.d Additional .ini files parsed: /usr/local/etc/php/7.0/conf.d/ext-pdo_pgsql.ini 

My php.ini looks like this:

[opcache] ; Determines if Zend OPCache is enabled opcache.enable=1 

However, when I look at phpinfo() it shows the following: enter image description here enter image description here

I've restarted Apache after making the change to my php.ini to include opcache, but it doesn't appear to be recognised.

I installed PHP with Homebrew, not MAMP although I do have MAMP install but unused.

1
  • Which php.ini file did you edit? The CLI config file is in /usr/local/etc/, but your Apache config file is in /usr/local/php5/lib/. Commented Oct 17, 2017 at 16:13

1 Answer 1

1

I got to the bottom of this eventually...

In the output from phpinfo(), have a look at the .ini files listed under:

Additional .ini files parsed 

There may be something like

/usr/local/php5/php.d/20-extension-opcache.ini

Make sure opcache.enable=1 is set in this file.

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.