2

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

Community
  • 1
  • 1
Urs
  • 4,984
  • 7
  • 54
  • 116

1 Answers1

3

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.

  • That's what I've been thinking. What a pity! Thanks! – Urs Dec 23 '14 at 17:56
  • Oh, and memcached has no trouble with suPHP then, interesting! – Urs Dec 23 '14 at 18:42
  • Correct. memcached stores cached data in a separate, persistent server process, so the fact that PHP doesn't keep running doesn't matter. –  Dec 23 '14 at 18:51
  • alas, we don't have the memcached daemon running (I checked with the script from http://stackoverflow.com/a/11061667/160968), only the php extension. I'll have to give up acceleration on this server! Thanks again. – Urs Dec 23 '14 at 18:55