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.


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. Commented Feb 23, 2016 at 16:25
  • Yes, it may be it should be moved to Server Fault or another site. Commented Feb 23, 2016 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
    Commented Feb 23, 2016 at 21:30

2 Answers 2


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


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

  • Since updating MAMP (free version) It no longer let's me apply OPcache as the PHP-Cache option. I can select and click OK, but if I edit MAMP preferences again, it' always set to off. I confirmed via CLI which php.ini was being used and ensured the php.ini was set to enable OPCache but still MAMP won't allow me to turn it on; and the Drupal installation Window warns me that it's off. Has anyone else had this issue? Commented Jun 28, 2021 at 2:01
  • @AuxiliaryJoel Same problem in MAMP Pro, found a workaround I'm sure you can do a similar workaround in MAMP. stackoverflow.com/questions/74769696/… Commented Dec 12, 2022 at 10:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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