关闭MAMP中的缓存

Phi*_*ppe 11 php caching mamp opcache

试图在MAMP中关闭缓存以进行开发,等待缓存在进行小的更改后过期,这会降低我的工作效率.(当我更改为PHP 5.5.3时出现问题,更改回来并没有修复它)

在研究之后,我采取了以下步骤(未成功)禁用缓存:

注释掉php.ini中的OPcache行并重置mamp.(并尝试显示零值)

;zend_extension="/Applications/MAMP/bin/php/php5.5.3/lib/php/extensions/no-debug-non-zts-20121212/opcache.so"
;  opcache.memory_consumption=0
;  opcache.interned_strings_buffer=0
;  opcache.max_accelerated_files=0
;  opcache.revalidate_freq=0
;  opcache.fast_shutdown=1
;  opcache.enable_cli=0
Run Code Online (Sandbox Code Playgroud)

添加了PHP标头

   header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
   header("Cache-Control: post-check=0, pre-check=0", false);
   header("Pragma: no-cache");
Run Code Online (Sandbox Code Playgroud)

添加了html标题

<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
<meta http-equiv="pragma" content="no-cache" />
Run Code Online (Sandbox Code Playgroud)

我还使用谷歌浏览器中的选项在开启开发工具时关闭缓存.

我迷失在这里,想不出我能做的其他事情来禁用缓存.

更改PHP - 或 - HTML代码后,我必须等待约2分钟才能生效.但是,数据库更改似乎立即生效,因此我认为它是服务器端opcache.

我需要禁用MAMP使用的另一个缓存吗?(或另一步?)

Ric*_*dit 8

快进到 2022 年,MAMP 现在将其作为 UI 选项。

对于使用 MAMP Pro for OSX (Monterey) 的任何人,都可以通过“查看模式”切换(至“专家”模式)来访问 PHP 设置。默认情况下,它设置为“标准”模式并隐藏其中许多选项。

单击左栏中的 PHP 选项卡,然后转到“缓存模块以加速执行”下拉列表。选择“关闭”。


Iva*_*rst 7

@Philippe,确保你注释掉了OPcache

/Applications/MAMP/bin/php/php5.5.3/conf/php.ini

不是那个

/Applications/MAMP/conf/php5.5.3/php.ini