phpmacosmamp

MAMP time between seeing live changes


I'm using MAMP server and wondering why changes I make to the PHP files are not instantaneously displayed when I page refresh (in browser). Is there a way to set this up? There are no caching settings on MAMP. Either I have to wait 20 seconds or stop and restart the server.


Solution

  • The solution is to comment out lines in the php.ini file which can be found in /MAMP Directory/bin/php/php5.5.3/conf/php.ini

    Comment out Opcache:

    [OPcache]
    ;zend_extension="/Applications/MAMP/bin/php/php5.5.3/lib/php/extensions/no-debug-non-zts-20121212/opcache.so"
    ;  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
    

    Documentation (yes it started in 5.5):

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