Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I Disable the Code Cache for PHP 5 (FPM) with Nginx?

Tags:

php

caching

nginx

When I save changes to a PHP file and then reload, it continues to execute the old version of the script for a minute or so regardless of how many refreshes I do. After 1 minute (or so) it executes the current version.

How do I disable this behaviour so changes occur immediately?

Setup is PHP-FPM with Nginx.

like image 719
Nick Avatar asked Dec 04 '13 00:12

Nick


1 Answers

My solution was in the Zend OPCache configuration rather than APC.

I installed the vanilla version of WNMP (PHP 5.5.11) on my Windows 8.1 box and discovered in my php.ini file's [opcache] section that the Zend OPCache was enabled and only checking file changes once every 60 seconds (opcache.revalidate_freq=60). Look for that config directive and set it to 0 to force the OPCache to check php files on each request.

like image 157
Blake B. Avatar answered Sep 28 '22 00:09

Blake B.