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";
?>
5
  • The php.ini for 5.5.x in MAMP has probably some kind of caching activated. Commented Oct 5, 2013 at 15:42
  • Wouldn't ExpiresDefault take care of caching? Why is expires not seen in 5.5.3 phpInfo? Commented Oct 5, 2013 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. Commented Oct 5, 2013 at 18:30
  • Maybe it's a browser issue (and it just correlates accidentially with the PHP version change) ? Commented Oct 5, 2013 at 18:40
  • I determined it's not a browser issue. Commented Oct 6, 2013 at 11:22

1 Answer 1

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
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.