在 MAMP 中停止缓存 PHP 5.5.3

Stop caching for PHP 5.5.3 in MAMP(在 MAMP 中停止缓存 PHP 5.5.3)
本文介绍了在 MAMP 中停止缓存 PHP 5.5.3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

在带有 PHP 5.5.3 的新 Macbook 上安装 MAMP.

Installed MAMP on a new Macbook with PHP 5.5.3.

重新加载和刷新什么都不做.依然没有.谷歌几分钟试图找出问题所在,回来刷新.有用.有没有搞错?

Reload and refresh do nothing. Still nothing. Google around for a few minutes trying to find out what is wrong, come back and refresh. It works. What the heck?

我进入 php.ini 并禁用所有新的 OPcache 并将默认缓存时间设置为 0.向文档添加标题以强制不缓存.还是一样的问题.这到底是怎么回事?

I went into php.ini and disabled all the new OPcache and set the default cache time to 0. Added headers to the document to force no caching. Still same problem. What the heck is going on here?

网络选项卡显示 HTTP 200 请求,因此 index.php 文件中的任何新 HTML 都可以正常呈现,但需要由服务器呈现的新 PHP 被延迟并且直到一些预定的时间过去了,我不知道如何改变.怎么回事?

The network tab is showing a HTTP 200 request, so any new HTML in the index.php file renders fine, but new PHP that needs to be rendered by the server is delayed and not rendered until some predetermined set of time passes that I don't know how to change. What's going on?

我也在 Safari 中检查了这个,所以它肯定是服务器的事情阻止了文件的呈现.

I checked this in Safari too so it is definitely a server thing that is keeping the file from rendering.

有趣的事实是,如果我进入 MAMP 并将 PHP 版本更改为旧版本(PHP 5.2 或其他版本),它将正常呈现,没有缓存问题".切换到 PHP 5.5,它挂了.在 MAMP 首选项中,5.5 的缓存选项甚至不存在并且会自动禁用.

Interesting fact though, if I go into MAMP and change the PHP version to the old one (PHP 5.2 or something) it will render normally, with no "caching issues". Switch to PHP 5.5 and it hangs up. In the MAMP preferences caching options for 5.5 don't even exist and are automatically disabled.

推荐答案

禁用 OPCache

MAMP 现在默认开启 OPCache,你可以通过编辑你的 php.ini 文件来禁用它.确保您编辑了正确的 php.ini.

MAMP now turns on OPCache by default, you can disable it by editing your php.ini file. Make sure you edit the correct php.ini.

我自己也遇到了同样的问题.默认情况下,PHP 5.5.3 版的 MAMP 运行 OPcache,但您无法像使用旧版 PHP 5.2.17 那样在 GUI 中关闭它.您必须手动注释掉 php.ini 文件(MAMP/bin/php/[version]/conf/php.ini)末尾的所有 OPcache 行,并确保停止和启动服务器以进行更改效果.

I was running into the same problem myself. MAMP with PHP version 5.5.3 runs OPcache by default, but you can't turn it off in the GUI like you can with the older PHP version 5.2.17. You have to manually comment out all the OPcache lines at the end of the php.ini file (MAMP/bin/php/[version]/conf/php.ini) and make sure to stop and start the servers for the changes to take effect.

我更新了 URI,更改也可以通过更改 php 文件夹下的/conf/来反映,但似乎 MAMP 在重启后会忽略这些.

这篇关于在 MAMP 中停止缓存 PHP 5.5.3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)