Stop MAMP delay between saving and viewing changes

David Carr

Development Tutorials

I’ve noticed recently when using MAMP to test PHP 7 that changes are not shown right away when looking at the browser. Sometimes it can be a few seconds before the changes are updated. That can be misleading if you don’t reliase it’s cached. 

Turns out from PHP 5.5 opcache is turned on my default

OPcache improves PHP performance by storing precompiled script bytecode in shared memory, thereby removing the need for PHP to load and parse scripts on each request.

This extension is bundled with PHP 5.5.0 and later

http://www.php.net/manual/en/intro.opcache.php

To turn it off located your php.ini file in my case it was located at my php/ect/php.ini and the opcache section and turn them off by placing a ; at the beginning.

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

Stop and start the server, once it’s back up no delay will occur.

 

Fathom Analytics $10 discount on your first invoice using this link

Help support the blog so that I can continue creating new content!

Sponsor

Fathom Analytics $10 discount on your first invoice using this link

Subscribe to my newsletter

Subscribe and get my books and product announcements.

© 2006 - 2024 DC Blog. All code MIT license. All rights reserved.