18

Trying to turn off caching in MAMP for development, waiting for cache to expire after making small changes is killing my productivity. (Problem started when I changed to PHP 5.5.3, changing back doesn't fix it)

After researching I've taken the following steps to (unsuccessfully) disable cache:

Commented out OPcache lines in php.ini and reset mamp. (and tried zero values shown)

;zend_extension="/Applications/MAMP/bin/php/php5.5.3/lib/php/extensions/no-debug-non-zts-20121212/opcache.so"
;  opcache.memory_consumption=0
;  opcache.interned_strings_buffer=0
;  opcache.max_accelerated_files=0
;  opcache.revalidate_freq=0
;  opcache.fast_shutdown=1
;  opcache.enable_cli=0

added PHP headers

   header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
   header("Cache-Control: post-check=0, pre-check=0", false);
   header("Pragma: no-cache");

added html headers

<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
<meta http-equiv="pragma" content="no-cache" />

I'm also using the option in google chrome to turn off caching when dev tools are open.

I'm lost here, can't think of anything else I can do to disable cache.

After changing PHP - OR - HTML code I have to wait about 2 mins for it to take effect. However database changes seem to take effect immediately so I think its a server side opcache.

Is there another cache that MAMP uses that I need to disable? (or a different step?)

Philippe
  • 539
  • 1
  • 5
  • 21
  • 1
    It's been over a week, and not even a suggestion? Same problem here... @Philippe, just to make sure we're on the same page, ensure you commented out OPcache in `/Applications/MAMP/bin/php/php5.5.3/conf/php.ini`, not the one in `/Applications/MAMP/conf/php5.5.3/php.ini`. This is according to Husky's comment here: http://stackoverflow.com/questions/19073270/stop-caching-for-php-5-5-3-in-mamp – Ivan Durst Jan 30 '14 at 19:58
  • @IvanDurst I had commented it out here, `/Applications/MAMP/conf/php5.5.3/php.ini` not here `/Applications/MAMP/bin/php/php5.5.3/conf/php.ini` commenting out in the second location solved my problem put it as in answer and I will mark as accepted! – Philippe Feb 03 '14 at 20:14
  • update: commenting out opcache here `/Applications/MAMP/bin/php/php5.5.3/conf/php.ini` and restarting apache solved my problem - still works without caching when I commented out the PHP headers and the meta no cache tags. – Philippe Feb 03 '14 at 20:30
  • ive done all of this and still 8mb limit – AGrush Jan 11 '22 at 17:41
  • @AGrush not sure what you mean, nothing here is about memory limit. Also keep in mind this is from 2014, so this may be way outdated. – Philippe Jan 16 '22 at 22:21

2 Answers2

14

@Philippe, Ensure you commented out OPcache in

/Applications/MAMP/bin/php/php5.5.3/conf/php.ini

not the one in

/Applications/MAMP/conf/php5.5.3/php.ini

Ivan Durst
  • 1,163
  • 2
  • 12
  • 24
7

Fast-forwarding to 2022, MAMP now has this as a UI option.

For anyone on MAMP Pro for OSX (Monterey), the PHP setting can be accessed through the "View Mode" toggle (to "Expert" mode). By default, it's set to "Standard" mode and hides many of these options.

Click on the PHP tab in the left column, then go to dropdown with "Cache module to speed up execution". Select "off".

Ricebandit
  • 233
  • 4
  • 12