phpcachingapcsuphp

apcu and suPHP - possible?


Is it possible to use apcu (as a php 5.5 module) in combination with suPHP?

The answer to What is best PHP Handler for APC says no:

suPHP also cannot work with an opcode caching extension such as eAccelerator or APC

but this post is over a year old and maybe not referring to apcu.

I can successfully enable the apcu module (in cPanel) and transfer content via apc_store and apc_fetch - but not between requests. It forgets what I've been storing when I reload the script/page.

So my first concern is to rule out if I'm trying something that's impossible anyway?

PS: for the record, What is userland caching APCu extension in PHP? gives some helpful background


Solution

  • Not possible.

    suPHP runs each PHP request in a new process, so caching extensions that try to save data in memory across requests don't work. (Or, rather, they work, but any stored data is only accessible to that job, and is lost at the end of the request.)

    Use something like memcached if you need data caching.