在OSX和PHP版本5.5.3中使用MAMP时,不会立即显示php编辑 [英] php edits not displayed immediately when using MAMP in OSX and PHP Version 5.5.3

查看:53
本文介绍了在OSX和PHP版本5.5.3中使用MAMP时,不会立即显示php编辑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

更改php文件并刷新浏览器后,更改不会立即显示,但是15秒钟后刷新会显示更改. 但是,更改会立即显示在PHP 5.2.17版中,而不是PHP 5.5.3版中.

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报告php版本5.2.17的HTTP响应标头已过期,但PHP版本5.5.3的HTTP响应标头已过期.

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

这是一个已知问题吗,更高版本的php中有修复程序吗?

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

http.conf具有:

http.conf has:

  • LoadModule expires_module modules/mod_expires.so
  • 有效期至
  • 过期默认为现在"

在OSX Lion和Chrome浏览器中使用本地主机MAMP.

Using localhost MAMP in OSX Lion and Chrome browser.

用于测试的源代码.更改号码,点击刷新浏览器.

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

<?php
echo "Value is  4";
?>

推荐答案

如果您使用的是PHP版本5.5.3,则在MAMP偏好设置中有一个缓存. 同样的事情发生在我身上,我在那找到了解决方案:看到实时变化之间的MAMP时间

在您的MAMP目录中转到:/bin/php/php5.5.3/conf/php.ini
并评论Opcahe行:

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

这篇关于在OSX和PHP版本5.5.3中使用MAMP时,不会立即显示php编辑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆