php edits not displayed immediately when using MAMP in OSX and PHP Version 5.5.3

半腔热情 提交于 2019-12-02 15:23:30

问题


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";
?>

回答1:


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


来源:https://stackoverflow.com/questions/19199165/php-edits-not-displayed-immediately-when-using-mamp-in-osx-and-php-version-5-5-3

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!