Using MAMP, when I change a PHP file and save it, it takes 10-15 seconds for it to be available in my browser. HTML files update immediately. Example:
Example file:
<!DOCTYPE html>
<html>
<body>
<p>This is test</p>
</body>
</html>
When this file is named index.html and placed in MAMP/htdocs directory I can update it, save, open it at http://localhost/index.html
and the update is there. If I simply rename the file to index.php (no php code), update and save, I can sit there and refresh browser for 10-20 seconds before I see the update (the old file reloads until the new version appears). I'm a rookie and new to server side scripting, so I'm not sure what is going on with an update to a PHP file - is there some processing that happens by Apache(?) before the file is able to be served? Is my PHP configuration a possible cause?
MacBook Pro osx10.8.5 2.8 Core2Duo 8GB (yes, it's old) -- MAMP 2.2 using port 80 -- PHP 5.5.3 -- Same behavior in all browsers -- Same behavior without an internet connection, so I don't think it is some DNS lookup issue
I had the same issue and found the answer here MAMP time between seeing live changes
I followed this instructions:
The solution is uncommenting 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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With