Re: [Case Closed - Idiot Found Behind Keyboard] Re: [PHP] APC - problems with CLI & odd return values from apc_clear_cache()
| From: | Ray Hauge | Date: | Sat, 29 Jul 2006 14:27:09 +0000 |
| Subject: | Re: [Case Closed - Idiot Found Behind Keyboard] Re: [PHP] APC - problems with CLI & odd return values from apc_clear_cache() | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-239877@lists.php.net to get a copy of this message | ||
On Saturday 29 July 2006 05:47, Jochem Maas wrote:
> Jon Anderson wrote:
> > Just replying to the list on this one 'cause I'm pretty sure you're on
> > it. :-)
> >
> > AFAIK, with many caches the web server cache and CLI caches are
> > exclusive to each process. The APC manual seems to suggest that the CLI
> > cache is not connected to the web server cache:
> >
> > From: http://ca.php.net/manual/en/ref.apc.php
> >
> > apc.enable_cli *integer*
> >
> > <http://ca.php.net/manual/en/language.types.integer.php>
> >
> > Mostly for testing and debugging. Setting this enables APC for the
> > CLI version of PHP. Normally you wouldn't want to create, populate
> > and tear down the APC cache on every CLI request, but for various
> > test scenarios it is handy to be able to enable APC for the CLI
> > version of APC easily.
>
> thanks, you are right - what I thought had been working all this time had
> not, or atleast the code did work but it was clearing the cache belonging
> to the CLI, which was a pointless act!
>
> I'm an idiot.
>
> but wanting to clear the webservers APC cache from a cmdline script doesn't
> seem like such a stupid thing to want to do. but there is no nice way of
> doing it; so now I do this at the end of my cmdline script instead:
>
> exec('apachectl -k graceful');
>
> which sucks in so many ways it hurts .... but it does clear the APC cache
You could create a script that basically just does apc_clear_cache() et all.
and call it from lynx, curl, wget, etc. and throw that into a cron job. That
would technically get you to call the script from the cli, but it should
clear the webserver cache.
Ray