I am now running into this situation. However, it only seems to happen
when I use template inheritance, and I'm only changing the parent
template. The child template is recompiling fine, but APC isn't
getting the change. Sometimes it alternates between older versions,
sometimes it sticks to one old one. If I disable APC or restart
apache, all is good until I change the parent again.
> >>apcfunction exists, execute it to clear the cache. Do we know specifically
> >> what versions ofAPCthis affects?
>
> >> For the time being, you could patch the write_file routine yourself.
> >> Hopefully this problem will be short lived.
>
> >> On Fri, Nov 6, 2009 at 12:57 PM, matterk <
matt.erkk...@gmail.com> wrote:
>
> >>> Yeah, we actually had to turn offAPCcaching for opcodes in our dev
> >>> environments withapc.cache_by_default=0
>
> >>> Which is really less than ideal.
>
> >>> On Nov 6, 12:13 am, Steve E <
st...@effectivemarketingtenerife.com>
> >>> wrote:
>
> >>>> This is exactly the behaviour I had, but I had it on Windows using
> >>>> Apache andAPC, although it seemed isolated to one of my systems only.
>
> >>>> It's working fine (it seems) on my production platform:
>
> >>>> NGINX: 0.8.19
> >>>> PHP: 5.2.11 using PHP-FPM
> >>>>APC: 3.0.19
> >>>> OS: Centos 5.3
>
> >>>> I had never experienced this problem with any other php script.APC
> >>>> kept alternating between the previous version and the new version, and
> >>>> the only way to reset this (apart from removing the file itself from
> >>>> the cache) was to restartAPC.
>
> >>>> Although it's not Smarty's fault, this could trip up a lot of users
> >>>> and may be something you need to consider looking into further on how
> >>>> to avoid. If nothing else, maybe a flag to change the behaviour from
> >>>> doing remove/move to doing a copy over instead? Or detect ifAPCis in
> >>>> use then delete the file fromAPCso only one version remains?
> >>>>> I'm not sure if this is anAPCissue or a Smarty issue. I am seeing
> >>>>> multiple files inAPCwith different inode's but the exact same file
> >>>>> name, but this only appears to happen to smarty compiled template
> >>>>> files.
>
> >>>>> Steps to reproduce:
>
> >>>>> 1. Load a page, allow smarty to compile all templates andAPCto cache
> >>>>> those
> >>>>> 2. Make a change to a template file
> >>>>> 3. Reload the page now shows two files inAPCwith the same file name
> >>>>> but with different inode numbers, one is the updated compiled
> >>>>> template, the other is the old version.
>
> >>>>> The behavior we are seeing is that when you load a page, it seems to
> >>>>> randomly pick one of the files fromAPCto use as the compiled