5

I installed Drupal 8 on MAMP Pro with PHP 7. I am getting this warning in my Drupal reports page:

PHP OPcode caching Not enabled
PHP OPcode caching can improve your site's performance considerably. It is highly recommended to have OPcache installed on your server.

I looked in MAMP's PHP 7 ini file and I see this code which seems to be related to OPcode caching.

[OPcache]
MAMP_OPcache_MAMP
  opcache.memory_consumption=128
  opcache.interned_strings_buffer=8
  opcache.max_accelerated_files=4000
  opcache.revalidate_freq=60
  opcache.fast_shutdown=1
  opcache.enable_cli=1

So I am not sure if I need to do anything else to enable it, it seems to be enabled based on the code above. I googled around and could not find any specific documentation with regard to MAMP and PHP OPcode caching.

  • You're welcome, glad it helped. I posted the answer, but I'm not 100% sure if this is the right question to keep on DA. Moderators will decide I guess. – Aram Boyajyan Feb 23 '16 at 16:25
  • Yes, it may be it should be moved to Server Fault or another site. – Danny Englander Feb 23 '16 at 16:34
  • While there is overlap with SuperUser or AskDifferent (not ServerFault), MAMP is a common tool for Drupal development, and the question stems from a Drupal warning during setup. I think this makes is close enough to being on topic here in my eyes. – mpdonadio Feb 23 '16 at 21:30
8

Just make sure that the OPCache is selected as caching mechanism in MAMP preferences.

  1. Click on "Preferences".
  2. Click on the "PHP" tab.
  3. Select "OPcache" under "Cache" field.

MAMP screenshot - PHP settings and OPcache

6

The UI is slightly different for Mamp Pro. Some may find this screenshot helpful.

Mamp Pro UI differences for Opcache

More recent versions of MAMP Pro have a different layout for the UI.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.