0

After changing php file and refreshing browser, the change is not displayed immediately, but refreshing after 15 seconds shows the change. However, changes display immediately for PHP Version 5.2.17, but not PHP Version 5.5.3.

phpinfo reports HTTP Response Headers has expires for php version 5.2.17, but not for php version 5.5.3.

Is this a known issue, and is there a fix in later version of php?

http.conf has:

  • LoadModule expires_module modules/mod_expires.so
  • ExpiresActive On
  • ExpiresDefault "now"

Using localhost MAMP in OSX Lion and Chrome browser.

Source code for test. Change number, hit refresh browser.

<?php
echo "Value is  4";
?>
ezaspi
  • 684
  • 7
  • 25
  • The php.ini for 5.5.x in MAMP has probably some kind of caching activated. – Sliq Oct 05 '13 at 15:42
  • Wouldn't ExpiresDefault take care of caching? Why is expires not seen in 5.5.3 phpInfo? – ezaspi Oct 05 '13 at 17:58
  • httpd.conf has LoadModule php5_module /Applications/MAMP/bin/php/php5.2.17/modules/libphp5.so, but changing it to 5.5.3 doesn't help. I suspect because mod_expires.so is wrong version? This is a fresh install of MAMP. – ezaspi Oct 05 '13 at 18:30
  • Maybe it's a browser issue (and it just correlates accidentially with the PHP version change) ? – Sliq Oct 05 '13 at 18:40
  • I determined it's not a browser issue. – ezaspi Oct 06 '13 at 11:22

1 Answers1

6

There is a cache, in your MAMP preferences if you use the php version 5.5.3. The same thing happen to me, I found the solution there: MAMP time between seeing live changes

In your MAMP Dir go to : /bin/php/php5.5.3/conf/php.ini
And comment the Opcahe lines:

[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
Community
  • 1
  • 1
coding addicted
  • 3,422
  • 2
  • 36
  • 47